Answers for "laravel delete all"

PHP
2

delete all rows in table laravel

// Uncomment the below to wipe the table clean before populating

DB::table('table_name')->truncate();

//or

DB::table('table_name')->delete();
Posted by: Guest on September-02-2021
0

delete all rows from table laravel

MyModel::truncate();
Posted by: Guest on June-19-2020
0

Laravel Delete

Flight::destroy(1);

Flight::destroy(1, 2, 3);

Flight::destroy([1, 2, 3]);

Flight::destroy(collect([1, 2, 3]));
Posted by: Guest on April-27-2021
0

truncate table laravel eloquent

Visitor::query()->truncate();
Posted by: Guest on July-24-2020

Browse Popular Code Answers by Language