Delete Query in Laravel by model,Delete Query in Laravel 5.0 by model,Delete Query in Laravel 5.1 by model,Delete Query in Laravel 5.2 by model,Delete Query in Laravel 5.3 by model,Delete Query in Laravel 5.4 by model,Delete Query in Laravel 5.5 bymodel,Delete Query in Laravel 5.6 by model,Delete Query in Laravel 5.7 by model
How to delete a value by id in laravel. In this tutorial, you can easily read and teach in the laravel without creating a model, the query of delete is written like this.
DB::table('users')->where('id', 1)->delete();
But if you want to delete the data by model, then delete the query in the laravel is written in such a way that you have to type the model name.
Delete query syntex With Using Model Name
Modelname::where('id', 1)->delete();
User::where('id', 1)->delete();