How do you refactor this ??

Send your answer in telegram group as a reply to this post...
or comment it below

@codino

7 comments

$user = auth()->user() ?? User::find(1);
$user = auth()->user() ?? User::find(1);
$user = auth()->user() ?? User::find(1);
$user=auth()->check() ?? User::find(1);
$user = auth()->user() ?? User::find(1);
php < 7.4 => $user= auth->user()?:User::find(1);
Php = 7.4 => $user =auth()->user() ?? User::find(1);
$user = auth()->user() ?? User::findOrFail(1);