insert([ ['name'=>'PRUEBA', 'created_at'=>Date::now()] ]); $prueba_id = DB::table('regiones')->where('name','PRUEBA')->first()->id; DB::table('barrios')->insert([ ['name'=>'PRUEBA','region_id'=>$prueba_id, 'created_at'=>Date::now()], ]); } }