Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
code:laravel:code-snippets [2020/04/19 12:09] – [How to check if Logged in user is a member of a specific LDAP group] gerardorourkecode:laravel:code-snippets [2021/01/26 18:22] (current) – [Customization of the response returned when a user is authenticated] gerardorourke
Line 42: Line 42:
 } }
 </code> </code>
 +
 +
 +==== Customization of the response returned when a user is authenticated====
 +[[https://laravel.com/docs/7.x/authentication|Reference]]
 +
 +If you need more robust customization of the response returned when a user is authenticated, Laravel provides an empty authenticated(Request $request, $user) method that may be overwritten if desired:
 +<code php>
 +use Illuminate\Http\Request;
 +
 +/**
 + * The user has been authenticated.
 + *
 + * @param  \Illuminate\Http\Request  $request
 + * @param  mixed  $user
 + * @return mixed
 + */
 +protected function authenticated(Request $request, $user)
 +{
 +    return response([
 +        //
 +    ]);
 +}
 +</code>
 +
 +  *https://www.itsolutionstuff.com/post/laravel-set-selected-option-in-dropdown-menuexample.html
 +
  • code/laravel/code-snippets.1587294581.txt.gz
  • Last modified: 2020/04/19 12:09
  • by gerardorourke