laravel 5.4 change authentication users table name

前端 未结 2 1244
傲寒
傲寒 2020-12-29 15:15

I\'m currently using the laarvel5.4 authentication in my application; and I want to change the users table name while keeping its role as it is in the authe

2条回答
  •  忘掉有多难
    2020-12-29 16:06

    You can change the table name in the migration file and then change the table name variable in the User.php model.

    Example:

    class Flight extends Model
    {
        /**
         * The table associated with the model.
         *
         * @var string
         */
        protected $table = 'my_flights';
    }
    

    https://laravel.com/docs/5.4/eloquent#eloquent-model-conventions

提交回复
热议问题