Error in customizing Search Model in Yii Framework
<p>I'm very very new to <strong>Yii</strong> &amp; creating a web application that deals with <strong>Users</strong> &amp; <strong>Groups</strong> with Yii advanced app framework.<br>
Currently I have finished all database part &amp; creating models &amp; <strong>CRUD operations</strong> with the gii tool.</p>
<p><strong>Here is my related databases</strong> (<code>user_group.group_owner_id ----&gt; user.id</code>)
<a href="https://i.stack.imgur.com/fQInQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fQInQ.png" alt="enter image description here" /></a></p>
<hr />
<p><strong>Problem :</strong><br>
When I navigate to User groups page it shows all the groups of all the users.
but I want to show only the groups that he made.</p>
<p>So I customized the <code>UserGroupSearch</code> model as follows, but it throws a syntax error.</p>
<hr />
<p><strong>UserGroupSearch.php</strong></p>
<pre><code>public function search($params)
{
    $current_logged_user_id = Yii::$app-&gt;user-&gt;identity-&gt;id; //get the id of the current user

    $query = UserGroup::find()-&gt;where(['group_owner_id' = $current_logged_user_id]);

    $dataProvider = new ActiveDataProvider([
        'query' =&gt; $query,
    ]);

    $this-&gt;load($params);

    //other codes
}
</code></pre>
<hr />
<p><strong>Error :</strong></p>
<blockquote>
<p>PHP Parse Error – yii\base\ErrorException</p>
<p>syntax error, unexpected '=', expecting ']'</p>
</blockquote>
<p>error line number shows as the line with with the <code>where clause</code></p>