Is there a way to execute a function upon user authentication?
Here is the function for logging:
public function redirectPath()
{
if (Auth::user()->hasRole('admin')){
$bitacora = TblBitacora::create([
'accion' => 'Successful Admin Login',
'user_id' => Auth::id(),
'ip' => \Request::ip(),
]);
return '/';
}
}
I want to initiate this script:
@if(Auth::user()->??????????????????????????????????????????
<script>
$(function() {
$('#mostrarmodal').modal('show');
});
</script>
@endif