Answers for "$user = Auth() laravel"

PHP
8

laravel auth user_id

$userId = Auth::id();
Posted by: Guest on May-12-2020
1

laravel auth user in constructor

public function __construct()
{
  $this->middleware(function ($request, $next) {
    $this->user = Auth::user();
    return $next($request);
  });
}
Posted by: Guest on July-22-2021

Browse Popular Code Answers by Language