rest-api-with-lumen icon indicating copy to clipboard operation
rest-api-with-lumen copied to clipboard

Rename table user

Open yruama opened this issue 6 years ago • 1 comments

Is it possible to rename the table users ? I already have a user table for my admin panel.

Thanks!

yruama avatar Apr 05 '18 18:04 yruama

Yes, it is. As per Laravel docs, you should just add a protected variable called $table and set it to the name of your table on the user model.

class User extends Model
{
    protected $connection = 'myDB'; // If you want the specify your DB connection..

    protected $table = 'my_users_table'; // Specifying the table

....
}

BrunoPansani avatar Aug 07 '18 03:08 BrunoPansani