added automation
This commit is contained in:
@@ -32,6 +32,9 @@ class AuthController extends Controller
|
||||
$token = auth($data['provider'])->login($user);
|
||||
$user->last_seen_at = Carbon::now();
|
||||
$user->save();
|
||||
if (($data['provider'] ?? '') === 'customer') {
|
||||
\App\Services\Automation\AutomationEvents::fire('customer.login', (int) $user->id);
|
||||
}
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
$credentials = $request->only(['mobile', 'password']);
|
||||
@@ -69,6 +72,7 @@ class AuthController extends Controller
|
||||
}
|
||||
$token = auth($provider)->login($user);
|
||||
$user->update(['last_seen_at' => Carbon::now()]);
|
||||
\App\Services\Automation\AutomationEvents::fire('customer.login', (int) $user->id);
|
||||
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
@@ -97,6 +101,9 @@ class AuthController extends Controller
|
||||
$user->update([
|
||||
'last_seen_at' => Carbon::now()
|
||||
]);
|
||||
if ($provider === 'customer') {
|
||||
\App\Services\Automation\AutomationEvents::fire('customer.login', (int) $user->id);
|
||||
}
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
|
||||
@@ -151,6 +158,9 @@ class AuthController extends Controller
|
||||
$user->last_seen_at = Carbon::now();
|
||||
$user->token_sms = null;
|
||||
$user->save();
|
||||
if (($data['provider'] ?? '') === 'customer') {
|
||||
\App\Services\Automation\AutomationEvents::fire('customer.login', (int) $user->id);
|
||||
}
|
||||
return $this->respondWithToken($token);
|
||||
}
|
||||
throw new UnprocessableEntityHttpException('کد وارد شده اشتباه است');
|
||||
|
||||
Reference in New Issue
Block a user