We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i make multi guard on my project just for testing both guard have the same persmissions but the other guard wont login
here is the auth.php
guards' => [ 'web' => [ 'driver' => 'session', 'provider' => 'users', ], 'worker' => [ 'driver' => 'session', 'provider' => 'workers', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ], ], 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\User::class, ], 'workers' => [ 'driver' => 'eloquent', 'model' => App\Worker::class, ],
and here is the loginController btw the loginattempt is working i checked it
protected $redirectTo = '/home'; /** * Create a new controller instance. * * @return void */ public function __construct() { $this->middleware('guest')->except('logout'); } protected function attemptLogin(Request $request) { if(Auth::guard('web')->attempt($this->credentials($request), $request->filled('remember'))) return true; elseif(Auth::guard('worker')->attempt($this->credentials($request),$request->filled('remember'))){ return true; } }
and here is my web routes
Route::get('/', ['as' => 'album.index', 'uses' => 'AlbumController@index']); Auth::routes(); Route::get('/home', 'HomeController@index')->name('home'); Route::group(['middleware' => 'auth'], function () { Route::get('logout', 'Controller@customLogout')->name('customLogout'); Route::group(['prefix' => 'album'], function () { Route::get('/showAllAlbums', ['as' => 'album.showAllAlbums', 'uses' => 'AlbumController@showAllAlbums']); Route::get('create', ['as' => 'album.create', 'uses' => 'AlbumController@create']); Route::post('create', ['as' => 'album.store', 'uses' => 'AlbumController@store']); Route::get('/{id}', ['as' => 'album.show', 'uses' => 'AlbumController@show']); Route::get('delete/{id}', ['as' => 'album.destroy', 'uses' => 'AlbumController@destroy']); // upload Photos Routes Route::get('/uploadPhoto/{id}', ['as' => 'photo.create', 'uses' => 'PhotoController@create']); Route::post('/uploadPhoto', ['as' => 'photo.store', 'uses' => 'PhotoController@store']); }); Route::group(['prefix' => 'photo'], function () { Route::get('/{id}', ['as' => 'photo.show', 'uses' => 'PhotoController@show']); Route::get('delete/{id}', ['as' => 'photo.destroy', 'uses' => 'PhotoController@destroy']); }); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
i make multi guard on my project just for testing both guard have the same persmissions but the other guard wont login
here is the auth.php
and here is the loginController btw the loginattempt is working i checked it
and here is my web routes
The text was updated successfully, but these errors were encountered: