Skip to content

Tag: laravel

Why is only the last element of an array being output in Laravel?

I have a select where a value needs to be selected. Select is formed using a foreach loop. I get the values ​​correct and correct, but when I try to put this value into the session, only the last value of the cycle gets into it all the time. Why is that? Answer In your loop you overwrite the key

Get API over VPN with PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last year. Improve this question I have a question with my problem. I have a task where I want to get the REST API but the API …

Ways to write Laravel routes

Is there a better way to write these routes? It seems I am repeating the same controller in my route files. Answer You can use a resource route, where you specify a subset of actions in the controller. You can also use the –model option when generating a controller with the stubbed out CRUD methods. Res…