Laravel 5 - Remove Parameter From All Request Objects at Controller Level : <p>I have URLs that look like:</p>

<pre><code>http://example.com/api/user?id=45&amp;name=mike&amp;api_token=2348283
http://example.com/api/project?id=5&amp;description=first&amp;api_token=2348283
etc...
</code></pre>

<p>In my controllers, I have functions that look like:</p>

<pre><code>public function user_get_endpoint(Request $request){

    $request = $request-&gt;toArray();
    return UserModel::where($request)-&gt;get()-&gt;toArray();

}
</code></pre>

<p>The above will currently break since the <code>$request</code> object contains a property called <code>api_token</code> which does not exist in the <code>user</code> table.  I am using the <code>api_token</code> in a middleware to check for authentication.</p>

<p>I can manually unset the <code>api_token</code> property in each of my API functions by using <code>unset($request['api_token']</code>, but I'd like to avoid that if possible.</p>

<p>Is there anyway to do this application wide or at a class or controller level?</p>
