Laravel overwrite toArray with custom parameter
<p>In my controller I have:</p>

<pre><code>$Locations = Locations::where(something);       
$Locations-&gt;get()-&gt;toArray(true);
</code></pre>

<p>And inside the model: </p>

<pre><code>function toArray($include_all = false) {
   var_dump($include_all);
}
</code></pre>

<p>The include all variable is false, although the function gets called.
Is there a reason why it's doing that ?</p>

<p>I want to call a custom toArray because I have more oneToMany relations with different structures that I want to change (some of them are serialized for example)</p>

<p>Thank you</p>