Merge pull request #3817 from turbo124/v2
Update last logged in for client contact
This commit is contained in:
commit
ef3c677a05
2 changed files with 5 additions and 0 deletions
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Events\Contact\ContactLoggedIn;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\ClientContact;
|
||||
use Auth;
|
||||
|
|
@ -62,6 +63,8 @@ class ContactLoginController extends Controller
|
|||
{
|
||||
Auth::guard('contact')->login($client, true);
|
||||
|
||||
event(new ContactLoggedIn($client));
|
||||
|
||||
if (session()->get('url.intended')) {
|
||||
return redirect(session()->get('url.intended'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ class UpdateContactLastLogin implements ShouldQueue
|
|||
$client_contact = $event->client_contact;
|
||||
|
||||
$client_contact->last_login = now();
|
||||
$client_contact->client->last_login = now();
|
||||
|
||||
$client_contact->save();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue