I know two method:
The first is using a Request
object param in the controller's function
public function index(Request $request)
{
$user = $request->user();
return view('home');
}
The second is using directly the Auth
facade.
public function index()
{
$user = Auth::user();
return view('home');
}
Are there any diferences? Are one method better that the other one and, if, yes, why?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire