Skip to content

Instantly share code, notes, and snippets.

@fhulufhelo
Last active August 14, 2019 09:12
Show Gist options
  • Save fhulufhelo/c7c6d57c9f26439d30e5e3299a881299 to your computer and use it in GitHub Desktop.
Save fhulufhelo/c7c6d57c9f26439d30e5e3299a881299 to your computer and use it in GitHub Desktop.
<?php
namespace Illuminate\Http\Concerns;
// InteractsWithInput
/**
* Get the user for the incoming request.
*
* @param \Illuminate\Http\Request $request
* @return mixed
*/
public function user(Request $request)
{
if ($request->bearerToken()) {
return $this->authenticateViaBearerToken($request);
} elseif ($request->cookie(Passport::cookie())) {
return $this->authenticateViaCookie($request);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment