Answers for "laravel eloquent where in"

PHP
3

laravel findorfail

$model = App\Flight::where('name', 'Mike')->firstOrFail();
Posted by: Guest on June-20-2020
2

laravel eloquent remove from db

$res=User::where('id',$id)->delete();
Posted by: Guest on November-05-2020
2

laravel eloquent remove from db

public function destroy($id){

  $res=User::find($id)->delete();
  if ($res){
    $data=[
    'status'=>'1',
    'msg'=>'success'
  ];
  }else{
    $data=[
    'status'=>'0',
    'msg'=>'fail'
  ];
  return response()->json($data);
Posted by: Guest on November-05-2020
1

larave Soft Deletes

Schema::table('flights', function (Blueprint $table) {
    $table->softDeletes();
});
Posted by: Guest on June-12-2020
0

where in laravel

$users = Users::whereIn('id', array(1, 2, 3))->get()
Posted by: Guest on July-27-2021
0

laravel where in

$users = DB::table('users')->whereIn('id', array(1, 2, 3))->get()
Posted by: Guest on June-24-2021

Code answers related to "laravel eloquent where in"

Browse Popular Code Answers by Language