ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Add default provider #93

Closed Anahkiasen closed 9 years ago

Anahkiasen commented 9 years ago

Currently switching to Multiauth is very complicated because every call to Auth becomes invalid. It would be nice to be able to specify which of the authentications is the default one so that calls to Auth:: delegate to it via __call. Example:

    'default' => 'app',
    'multi' => array(
        'app' => array(
            'driver' => 'eloquent',
            'model' => 'Account'
        ),
        'admin' => array(
            'driver' => 'database',
            'table' => 'users'
        )
    ),
Auth::admin()->check(); // Works as expected
Auth::check(); // Delegates to Auth::app()->check()