My guess was to use the following syntax: MyModel::all()->delete(); But that did not work. I’m sure it’s super simple, but I’ve searched for documentation on the subject and can’t...
I just can’t solve this one. I’m on Linode 1G RAM basic plan. Trying to install a package via Composer and it’s not letting me. My memory limit is...
I am pretty new to Laravel 4 and Composer. While I do Laravel 4 tutorials, I couldn’t understand the difference between those two commands; php artisan dump-autoload and composer...
I’m having trouble to write query in laravel eloquent ORM. my query is SELECT book_name,dt_of_pub,pub_lang,no_page,book_price FROM book_mast WHERE book_price NOT IN (100,200); Now I want to convert this query...
I am trying to redirect to the previous page with a message when there is a fatal error. App::fatal(function($exception) { return Redirect::back()->with('msg', 'The Message'); } In the view trying...
This seems like a pretty basic flow, and Laravel has so many nice solutions for basic things, I feel like I’m missing something. A user clicks a link that...
I would like to make a timestamp column with a default value of CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP using the Laravel Schema Builder/Migrations. I have gone through the Laravel documentation...
I’m trying to create foreign keys in Laravel however when I migrate my table using artisan i am thrown the following error: [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1215 Cannot add...
This question already has answers here: Laravel Eloquent: Ordering results of all() (12 answers) Closed 6 years ago. Simple question – how do I order by ‘id’ descending in...
I’m stuck on a simple task. I just need to order results coming from this call $results = Project::all(); Where Project is a model. I’ve tried this $results =...