Differences
This shows you the differences between two versions of the page.
| 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] gerardorourke | code:laravel:code-snippets [2021/01/26 18:22] (current) – [Customization of the response returned when a user is authenticated] gerardorourke | ||
|---|---|---|---|
| Line 42: | Line 42: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | |||
| + | ==== Customization of the response returned when a user is authenticated==== | ||
| + | [[https:// | ||
| + | |||
| + | If you need more robust customization of the response returned when a user is authenticated, | ||
| + | <code php> | ||
| + | use Illuminate\Http\Request; | ||
| + | |||
| + | /** | ||
| + | * The user has been authenticated. | ||
| + | * | ||
| + | * @param | ||
| + | * @param | ||
| + | * @return mixed | ||
| + | */ | ||
| + | protected function authenticated(Request $request, $user) | ||
| + | { | ||
| + | return response([ | ||
| + | // | ||
| + | ]); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | *https:// | ||
| + | |||