Laravel Model

  • To create a new model
    php artisan make:model model_name

    This will make a model file in App directory. As a result, when refrence the model in tinker, you would need to referenced as App/model_name rather than App/Models/model_name

  • To change that, move the file to App/Models
    • change name space in the model file.
      namespace App\Models;
    • In the model class, make sure you have
      protected $table = 'table name';
          protected $fillable = [
              a list column names eligible for mass assignment