I'm using the Laratrust
package to manage the authentification
.
Now I'm trying to adding a new condition to autheticate.
The user should have the status=1
to login.
So I'm using the function autheicate() defined in laratrust , I'm just adding the column status to verify the authentification.
So I have the following code :
public function authenticate()
{
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password','status'->'1'), $this->boolean('remember'))) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
But I'm getting the following error :
syntax error, unexpected ''1'' (T_CONSTANT_ENCAPSED_STRING), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'
If you have any idea about how I can add the condition status to my code , help me.
Thank you in advance.
Please Add Status Middleware In Karnal.php in routeMiddleware array app/http/karnal.php