I want to rewrite onceBasic()
of Illuminate\Auth\SessionGuard
by extending Facades\Auth
, but encountering the problem of not being able to access the helper protected function of SessionGuard
class.
Here is how I extends Auth facades:
namespace App\MyFacades;
use \Illuminate\Support\Facades\Auth;
class Auth_QuyLe extends Auth {
/**
* Create your custom methods here...
*/
public static function onceBasic_QuyLe($field = 'name', $extraConditions = [])
{
$credentials = self::basicCredentials(self::getRequest(), $field);
if (! self::once(array_merge($credentials, $extraConditions))) {
return self::failedBasicResponse();
}
}
}
When I call onceBasic_QuyLe()
from my middleware, it shows
"Method Illuminate\Auth\SessionGuard::basicCredentials does not exist."
I've already updated my class to config/app.php and run composer dump-autoload && php artisan config:cache