Answers for "delete data in laravel"

PHP
2

get soft deleted data laravel

To also get soft deleted models : 

$trashedAndNotTrashed = Model::withTrashed()->get();

Only soft deleted models in your results : 

$onlySoftDeleted = Model::onlyTrashed()->get();
Posted by: Guest on November-28-2020
0

delete all rows from table laravel

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

Code answers related to "delete data in laravel"

Browse Popular Code Answers by Language