delete using eloquent laravel code example
Example 1: laravel delete where
DB::table('users')->where('id', $id)->delete();
Example 2: laravel fillable
/**
* The attributes that are mass assignable.
*/
protected $fillable = [
'title',
'slug',
'body',
'image',
'published',
'comments_open'
];
Example 3: laravel eloquent remove from db
$res=User::where('id',$id)->delete();
Example 4: laravel scope
public function apply(Builder $builder, Model $model)
{
$builder->where('age', '>', 200);
}