How to delete all the rows in a table using Eloquent?
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 … Read more
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 … Read more
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 … Read more
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 … Read more
I can create a model and resource controller (binded to model) with the following command php artisan make:controller TodoController –resource –model=Todo I want … Read more
This seems like a pretty basic flow, and Laravel has so many nice solutions for basic things, I feel like I’m missing something. … Read more
I would like to retrieve the last file inserted into my table. I know that the method first() exists and provides you with … Read more
lets say I have 7 columns in table, and I want to select only two of them, something like this SELECT `name`,`surname` FROM … Read more
I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following … Read more
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] … Read more
I’m on Ubuntu 14.04 and I’ve been trying all possible methods to install Laravel to no avail. Error messages everything I try. I’m … Read more