Closed benrolfe closed 6 years ago
You can do it like this
public function index(Request $request)
{
$query = $request->query();
if (array_key_exists('version', $query) === false) {
$query['version'] = \App\System::getVersion();
}
$request = RequestCreator::createWithParameters($query);
return (new QueryBuilder(new Code(), $request))->build()->paginate();
}
I then get this error: "ErrorException Undefined index: PATH_INFO"
.
Can anyone help?
@benrolfe If you use nginx check your fastcgi_params, you must have there next line
fastcgi_param PATH_INFO $fastcgi_path_info;
If you use some other web server, check the documentation for your web server
I'd like to apply an extra 'where' clause to every request.
ie: For an incoming API request I want to limit the results to only return results that are "owned" by the requesting user. I need to add an additional where clause for "organisation_id", which cannot be overridden through the URL's GET parameters.
Without success, I've already tried
$request->query->add(['organisation_id' => 5]);
and$_GET['organisation_id'] = 5
.Any suggestions?