Laravel if statement for request object
<p>Currently building out an API. I am working on an update function with excepts the incoming request. so: api.dev.com/?api_key=asdf&amp;storeid=2 etc</p>

<p>now in the backend i am accepting the Request and then i am trying to write some logic to check if the request includes storeid then update that entry etc. </p>

<p>But when i am writing my logic and i do</p>

<pre><code>if(isset($request-&gt;storeid))
    $store-&gt;id = $request-&gt;storeid;
</code></pre>

<p>If I do not include storeid in my put request then i get: </p>

<pre><code>Call to a member function parameter() on a non-object
</code></pre>

<p>Because it is not present. Am I approaching writing this logic the wrong way? </p>

<p>I want to leave it up to the users to update the records they want. So they should not have to include all the variables in the request. Just those that need to be updated. </p>

<p>Citti</p>