After php artisan migrate:fresh I get error: SQLSTATE[42000]: Syntax error or access violation: 1072 Key column ‘proform_id’ doesn’t exist in table (SQL: alter table proforms add constraint proforms_proform_id_foreign foreign key (proform_id) references proforms (id) on delete cascade) This …
Tag: laravel
Adding custom collection to the eloquent within Laravel Query Builder
I have a query and I want to add a collection using Laravel query builder. Well, this returns: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters (SQL: select [{“id”:1,”name”:”John Avenue”},{“id”:4,”name”:”Ontirio …
How do i debug my php code inside my html?
I’m using Laravel for my project. I wrote some PHP code inside HTML which basically under my .blade.php file. I’m trying to debug variable $highestRow inside tbody tag. I tried var_dump($highestRow) but my controller is just passing over the breakpoint. I’m looking for some x_debug() thing t…
Laravel Task Scheduler always failed
Task Scheduler with call method always fail when I add onFailure callback Basic test: I’m wrong somewhere or missing something ? Thanks in advance Answer UPDATE: I submitted a PR to fix this in the Laravel framework and it was just merged. Looks like this will work in Laravel 8 (due to be released next …
Laravel 7: Generate named view-routes from blade files in directory
Is there a nice way, to solve this issue: I have a folder ressources/views/project/content with several blade teplates, let’s say: Right now, I define one view route per file: How can I create these routes on thy fly? I could solve it with a loop through all files in this directory, but maybe there is a…
Dates not casting after upgrading to Laravel 7
I have just upgraded from Laravel 6 (PHP 7.4) to Laravel 7 (PHP 7.4) and casting dates in a model has completely stopped working. For example, in my User model, I have the following $dates array: …
Laravel Redirecting to a route is not working?
I am new to Laravel, when I am using redirect()->route(‘route_name’) after saving data, it does not work. Here is my controller function: Here are my routes : Any help will be appreciated. Answer You need to add the return keyword
how to stop adding more data in array in foreach loop
i looping 2 array a date and the data i am expecting this result What actually getting Adding old $r to results array How to fix it i am trying to break it but can’t figure it out Answer I have some untested code, as I do not have your data but I think this code below should work, you
Laravel 7 relationship query data not working
I would like to query companies name through employees. Why didnt get any result? It not give any error. Companies model Employees model Employees controller Where i like to query This is the migrations for tables Answer please provide the foreign key to your relation … this relation means that the empl…
How can I display my products from the cart?
I am using Melihovv ShoppingCart. I want to display all products inside cart but I couldn’t. It shows the page but the products are not displaying. Here is my code And here is my view: Answer to display the content of the cart, I think you should use