[Refactor] Remove BackpackUser in favour of User [Laravel-Backpack/CRUD]

Upon installing Backpack\Base, Backpack publishes our own model for the admin, BackpackUser. This was done in order to: 1) make the installation as smooth as possible (before this we were asking the developer to add traits to their User model); 2) possibly allow the developer to add methods/attributes only to the admin;

It seems to me like (2) is rarely used, so it doesn't justify the added complexity for everybody. And (1) can be done in a different way: - upon installation, look for App\User.php or App\Models\User.php - if it exists, use that; if not, ask the developer to punch in his custom user model; - ask the developer if we can add a few traits to his User model (CrudTrait and a trait that fixes the password reset for admins); if so - add those traits; if not, ask the developer to do it manually;

This breaking change should: - make it a little more difficult to install Backpack (reply y/n to prompt in most cases); - make it easier to use packages like PermissionManager (see https://github.com/Laravel-Backpack/PermissionManager/issues/183);

Thoughts anyone?

Asked Nov 22 '21 09:11
avatar tabacitu
tabacitu

2 Answer:

Hi there, i think its confussing having two Users models. I agree it would be easier just leaving App/User.php

1
Answered Sep 10 '19 at 21:53
avatar  of rodrigoUriarte
rodrigoUriarte

I always use separate model and table for admin user's, I prefer promt with yes/no to add separate model for admins in install process

1
Answered Oct 03 '19 at 18:52
avatar  of lotarbo
lotarbo