Skip to content
Advertisement

How can I solve this “Undefined variable $last_number” from return line in laravel 8

I am using Laravel 8 to create an application. Here I need to Generate an Order Number for every order. For this, I use Helper and write this code. It works the very first time, from the second time it shows “Undefined variable $last_number” from return line.

JavaScript

from my controller I use this:

JavaScript

Advertisement

Answer

JavaScript

I think your code should be like that. I hope it is help you.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement