Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the Registrar Services in Laravel 5?

I added couple of fields to my user table and everywhere I read it said I also need to update the new fields in the app/Services/Registrar.php file. But I cannot find the Services folder anywhere! This is a new installation in Laravel 5 and here is the screen shot of my directory structure:

What happened to the Services Folder? When I test, I can see that the User::create() works but I dont know where its declared since I cant find the Registrar.php file.

enter image description here

like image 350
Neel Avatar asked Sep 01 '25 18:09

Neel


2 Answers

I added couple of fields to my user table and everywhere I read it said I also need to update the new fields in the app/Services/Registrar.php file.

This was removed in Laravel 5.1.

https://laravel.com/docs/5.1/upgrade#upgrade-5.1.0

Secondly, the App\Services\Registrar class used in Laravel 5.0 is no longer needed. You can simply copy and paste your validator and create method from this class directly into your AuthController. No other changes should need to be made to these methods; however, you should be sure to import the Validator facade and your User model at the top of your AuthController.

like image 54
ceejayoz Avatar answered Sep 04 '25 08:09

ceejayoz


You are using 5.1 version and it doesn't have such directory or service. This version uses AuthenticatesAndRegistersUsers traits for registering users.

like image 33
Maxim Lanin Avatar answered Sep 04 '25 06:09

Maxim Lanin