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
Tag: laravel
Laravel & vuejs cpanel share hosting app migration problem
I’m sorry for my English. Good day, developers, I need your help, I have an app that I must migrate https://creamedicinaprepagada.com/ It is developed in Laravel + VueJS, at the moment it is hosted in AWS CPANEL, but I must migrate to CPANEL HOSTINGER. I am passing all the files and databases from the AWS CPANEL to CPANEL HOSTINGER, the
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 is through a VPN.
Filtering Laravel datetime field for values after a certain time
I have an eloquent model that has a “start_time” field, which is of type dateTime, and I want users to be able to filter instances of the model based on time of day. So for example, the “start_time” field is in the format “2021-02-17 21:52:12” and I want the user to be able to send “08:00:00”, and then filter all
Laravel One to Many relationship not working – returns recursion
I am developing an application with Laravel 8 and I ran into very strange behavior. I have a Model called “Organisation”, this Organisation has many Users (Model from Jetstream). I did the relationship as usual: In Organisation Model: In User Model: I have a field on the users table called organisation_id which is declared in the migration as such: I
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. Result:
Error in showing laravel data to blade using eloquent
I have this Contractor Model And ContractorDetails Model I can retrieve all columns under the Contractors Model, but whenever I do this $contractors->ContractorDetails->id, it will show this error “Trying to get property ‘id’ of non-object” . however when I just use this $contractors->ContractorDetails, it is able to show this collection {“id”:6,”contractors_id”:24} My controller looks like this My blade file Any
How to split a string at a specific character but not replace that character?
I want to split at every ‘;’ and every ‘{‘ from the string below: It splits at the point of every ‘;’ and ‘{‘ but these characters are also removed which I don’t want. I used explode() function though it splits, but also replace that character. And how to multiple splitting in a string? expected result should look like that.
How to show specific order details and all products which belongs only to that specific order on same view
How to show specific order details and all products which belongs only to that specific order on same view? Trying this, but getting empty array when doing dd(). OrderController: web.php Product.php Order.php Answer I would suggest to change the name of your route param to id to consistency and readability In view generate url for your route as And in
no idea why i get this error : Method IlluminateViewView::paginate does not exist?
i am trying to paginate this data : if( $id_act!=”” && $id_sous!=”” && $id_secteur!=”” ) // category and sub categroy and secteur selected { $…