Badge "Illuminate \ Foundation \ Auth \ AuthenticatesAndRegistersUsers" not found in Laravel 5.3

How to solve this problem? I alreay tried to use the whole solution from the network, and I also tried to use Illuminate \ Foundation \ Auth \ AuthenticatesAndRegistersUsers, but none of them work ?. If anyone knows how to solve this, please help me. I want to get rid of this error. thanks in advance

<?php namespace App\Http\Controllers\Auth; use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Input; use Illuminate\Support\Facades\Redirect; use Illuminate\Routing\Controller as BaseController; use Theme; use Auth; use App\Login; use Illuminate\Foundation\Auth\ThrottlesLogins; use App\Http\Controllers\Auth\RegisterController; class LoginController extends BaseController { /* |-------------------------------------------------------------------------- | Login Controller |-------------------------------------------------------------------------- | | This controller handles authenticating users for the application and | redirecting them to your home screen. The controller uses a trait | to conveniently provide its functionality to your applications. | */ use AuthenticatesAndRegistersUsers, ThrottlesLogins; /** * Where to redirect users after login / registration. * * @var string */ protected $redirectTo = '/'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest', ['except' => 'logout']); } public function signin(){ if(Auth::check()){ return Redirect::to('/'); }else{ $theme = Theme::uses('default')->layout('default'); return $theme->of('login.sign-in')->render(); } } public function login(){ $data = array( 'email' => Input::get('email'), 'password' => Input::get('password') ); $validator= RegisterController::validator($data); if($validator){ return Redirect::to('/login')->withErrors([$validator->errors()->all() ]); }else{ return Redirect::to('/'); } } // RegisterController::create($data); // Login::Insert($data); // $checkuser = Login::Login($data); function logout(){ Auth::logout(); return Redirect::to('login'); } } 
+5
source share
1 answer

I think the Laravel 5.3 package does not have this feature. Please check here .

EDIT:

You need to make a few changes to how new users are verified and created because AuthenticatesAndRegistersUsers no longer exist in laravel 5.3

So you need to make changes:

1 No need to pass Guard and Registrar instances to the base constructor. Remove these dependencies completely from the controller constructor.

2 You do not need to use the App \ Services \ Registrar class, which is used in Laravel 5.0, just copy and paste your validator and create a method from this class directly into your AuthController.

Make sure to import the Validator facade and your user model at the top of your AuthController.

+8
source

All Articles