Skip to content

Tag: laravel

Laravel Update not working

I have table called admins and model called Admin. When i try to update the records it fails every time with one field. Above code is not updating record in DB. datatype for is_delete is tinyint. If i update name field it works with the same code like Can you help me why first code is not working. Answer Mode…

Do not stop loop when query fails. LARAVEL

I am uploading a .csv file to a controller in my laravel application, and the controller loops through all the rows of the file and create new rows in my database. I works pretty well, but the problem is that if one of the rows of the CSV has a problem, the loop will be stopped and the web page

how to force delete in laravel 5.4

I made a user management system with soft deletion and force deletion options. However, I’m having trouble getting the force deletion option to work. The route: Route::post(‘users/{user}/delete’, ‘…

localization FakerFactory does not work in laravel

I have a Post Model with these fields : Now I want to use laravel sedders and model factories to create fake fa_IR localized data and insert to posts table. For that I wrote this in database/factories/ModelFactory.php: Then I created a PostsTableSeeder class like this : And in AppServiceProvider.php added bel…