Skip to content

Instantly share code, notes, and snippets.

@nicolaskempf57
Created February 3, 2021 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicolaskempf57/c8f9c39c13b7eedfb73a9cf89c172c46 to your computer and use it in GitHub Desktop.
Save nicolaskempf57/c8f9c39c13b7eedfb73a9cf89c172c46 to your computer and use it in GitHub Desktop.
Laravel basics 1 : l'utilisateur connecte est accessible depuis la requête
<?php
namespace App\Actions\Account;
use App\Models\User;
class ShowDashboard
{
public function __invoke(Request $request, Client $client = null): Response
{
/** @var $user User * */
$user = $request->user();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment