October CMS : How to extend User class to add relationship?
<p>Hello there i'm new to October CMS and i just started with User class What i know i create relationship in laravel is so easy.</p>

<p>I have extended user plunging.</p>

<pre><code>    User::hasCountry()-&gt;get();

    public hasCountry($query){
        return $query-&gt;where('country',1);
    } 
</code></pre>

<p>SO i have created this relation but i dont know how to add into Extended User class.</p>

<p>I have found one solution </p>

<pre><code>public function boot()
{
    User::extend(function($model) {
        $model-&gt;addDynamicMethod('hasCountry', function($query) {
            return $query-&gt;where('country', 1);
        });
    });
}
</code></pre>

<p>But it is not extending or adding methode.</p>

<p>Please Help :)</p>