I added a custom method "has_access" to it, where I just do the following:
public function has_access() {
return \Auth::check();
}
But it doesn't work, even if I am logged in, since the REST controller checks if the result of the method is an instance of \Response.
Is this an error in the documentation: "This method may return a boolean (true will allow the request, false will return a default 401 response is returned), or a Response object."?
which means if $this->auth contains "has_access", and $this->has_access() exists, it will be called here, and the result will be stored in $valid_login. If a Response is returned, it is returned right away, if not it falls through.
So the documentation matches the functionality in the code.