1DB::table('users')->insert([
2 'email' => 'kayla@example.com',
3 'votes' => 0
4]);
1DistrictModel::insert([
2 'code' => $data->code,
3 'name' => $data->name,
4 'region_id' => $data->region_id,
5 'sorting' => $data->sorting,
6 ]);
1$affected = DB::table('users')
2 ->where('id', 1)
3 ->update(['votes' => 1]);
1# The easiest way to create a model instance is using the
2# make:model Artisan command:
3
4php artisan make:model Flight
5
6# If you would like to generate a database migration when you
7# generate the model, you may use the --migration or -m option:
8
9php artisan make:model Flight --migration
10php artisan make:model Flight -m