Answers for "create databse with eloquent laravel"

PHP
5

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
Posted by: Guest on April-22-2020
0

laravel observer

<?php

namespace App\Observers;

use App\Models\User;

class UserObserver
{
    /**
     * Handle the User "created" event.
     *
     * @param  \App\Models\User  $user
     * @return void
     */
    public function created(User $user)
    {
        //
    }

    /**
     * Handle the User "updated" event.
     *
     * @param  \App\Models\User  $user
     * @return void
     */
    public function updated(User $user)
    {
        //
    }

    /**
     * Handle the User "deleted" event.
     *
     * @param  \App\Models\User  $user
     * @return void
     */
    public function deleted(User $user)
    {
        //
    }

    /**
     * Handle the User "forceDeleted" event.
     *
     * @param  \App\Models\User  $user
     * @return void
     */
    public function forceDeleted(User $user)
    {
        //
    }
}
Posted by: Guest on September-17-2020

Code answers related to "create databse with eloquent laravel"

Browse Popular Code Answers by Language