Delete generic user model, migration and controller
Hello All.
I don't want to use the generic user model, migration table and controller which cames when a new laravel proyects start. So I delete it (the migration table, the controller and the model) but I get this output:
include(/home/julian/Documentos/Programacion/LARAVEL/portal/vendor/composer/../../app/Http/Controllers/Controller.php): Failed to open stream: No such file or directory".
In vender files, where I should delete that line? I cant' find it.
You can use a different migrations table. You have to change that in config/database.php which has an entry to customize it.
You don't have to use the Controller class. No need to delete it.
Regarding the user model, why would you do that ?
You can edit that model and add whatever behavior you need but deleting it ? Unless you're planning on making an application that uses no authorization nor authentication whatsoever, you're going to need the user model.
You can make your own but I can't imagine the benefit of it.
@psrz because there are different types of users, and therefore different tables in the DB and different controllers. So we call models and controllers differently. So, you say that it is not necessary to delete that generic model and controller? no matter how empty they are?
That has nothing to do with user login to use the system.
Example: A humane society uses the adopt a pet API. But only certain roles can connect with adopt a pet, therefore regular authorization is used to allow access to the MVC portion where you actually login to adopt a pet to add or edit animals.
@julianov I would suggest that you stick with 1 users table and use roles instead. What happens when a user suddenly have 2 accounts on the same email? Will they understand that the password is different? And which should be used with which login portal
@julianov Yes you can rename the User model to Citizen if you really need. But I wouldn't do that, because the User model is used at many places in the framework core and even if you manage to rename and let your code work, there's not real guarantee that it will work when you will code a new functionality where Laravel will need to retrieve a user.