Answers for "laravel flush some tables datas"

PHP
1

laravel clear table

// Delete everythin in the table

// Option 1 
Project::truncate();

// Option 2
Project::whereNotNull('id')->delete();

// Option 3
Project::where('id', 'like' '%%')->delete();

// Option 4
DB::table('projects')->delete();
Posted by: Guest on September-28-2021
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

Browse Popular Code Answers by Language