where id in laravel code example
Example 1: laravel where in array
$items = DB::table('items')->whereIn('id',[1,2,..])->get();
Example 2: laravel where in array
$items = Item::whereIn('id', [1,2,..])->get();
Example 3: laravel get ID from insert
$data = User::create(['name'=>'first']);
dd($data->id);
Example 4: laravel create get id
$id = $this->create($data)->id;