@firewizard thanks a lot for your attention. I've tried your suggestion altough I did not see the point of it. Indeed, I surely missed something as nothing got better :(, it did'nt actually get isolated auth methods for frontend and backend
Anyway your suggestions have helped me to try it another way and nearly get it all right !!
I'll try to resume my steps (hope not to miss nothing):
//1.- Fresh out-of-the-box L5 Installation
//2.- php artisan make:auth to get all the basic controllers, views, etc ... for Auth
//3.- Modification of AuthController as follows
.....
protected $guard = 'web';
.....
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
if(stristr($_SERVER['HTTP_HOST'],'backend')) $this->guard = 'admin';
}
//4.- Indicated in config/auth.php requested classes (also implemented), providers, guards ...
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
//my custom
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],
....
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
//My custom
'admin' => [
'driver' => 'eloquent',
'model' => App\AdminUser::class,
],
],
//5.- Isolated routes by subdomains at routes.php
Route::group(['domain' => 'frontend.mydomain.com'], function () {
// ...all the frontend routes
});
Route::group(['domain' => 'backend.mydomain.com'], function () {
// ...all the backend routes
});
Up here' I've nearly got what I need :: frontend.mydomain.com and backend.mydomain.com using different tables (and User / AdminUser classes) to Authenticate. HOWEVER, still work to do as my admin views show Auth::user() object is null. I suspect I did not tell my L5 application how to load user my app\AdminUser ......getting closer ......hope not to die struggling so much time :)