laravel create model
# The easiest way to create a model instance is using the
# make:model Artisan command:
php artisan make:model Flight
# If you would like to generate a database migration when you
# generate the model, you may use the --migration or -m option:
php artisan make:model Flight --migration
php artisan make:model Flight -m// If there's a flight from Oakland to San Diego, set the price to $99.
// If no matching model exists, create one.
$flight = App\Flight::updateOrCreate(
['departure' => 'Oakland', 'destination' => 'San Diego'],
['price' => 99, 'discounted' => 1]
);Schema::table('flights', function (Blueprint $table) {
$table->softDeletes();
});$flights = App\Flight::where('active', 1)
->orderBy('name', 'desc')
->take(10)
->get();DB::table('users')->where('id', $id)->delete();$flight = new Flight;
$flight->name = $request->name;
$flight->save();