I am developing an web backend for swiggy type of application. In that back-end i want to display all restaurants added by that particular partner user in header and that drop-down will display on all pages, so i want to do that get all restaurants and store on some place so that header can access and display it on every page. so how to do this? I am try to execute below code
if (Auth::guard('partner')->attempt(['email' => $request->email, 'password' => $request->password], $request->remember)) {
// if successful, then redirect to their intended location
$user = $userId = Auth::id();
echo '<pre>';
print_r($user);
exit;
return redirect('partners/employees');
}
but it gives me error not able to get user id. i want to display user's restaurants list which is added by current user in system on every page header as dropdown list. so how can i achieve this.