Call to a member function success() on boolean in CakePHP
<p>I am running into a problem with CakePHP 3.0 that does not make sense to me and would like your help solving. I am having a table name called users with a controller named the same (UsersController). I can view the users in the table without any problem, but when I insert, modify or delete a user I am getting an error.</p>

<p>When I do an insert I get the error message: <em>Call to a member function success() on boolean UsersController.php on line 56</em></p>

<p>If I look into the controller class it looks like</p>

<pre><code>public function add()
{
    $user = $this-&gt;Users-&gt;newEntity();
    if ($this-&gt;request-&gt;is('post')) {
        $user = $this-&gt;Users-&gt;patchEntity($user, $this-&gt;request-&gt;data);

        if ($this-&gt;Users-&gt;save($user)) {
            $this-&gt;Flash-&gt;success(__('The user has been saved.'));

            return $this-&gt;redirect(['action' =&gt; 'index']);
        } else {
            $this-&gt;Flash-&gt;error(__('The user could not be saved. Please, try again.'));
        }
    }
    $this-&gt;set(compact('user'));
    $this-&gt;set('_serialize', ['user']);
}
</code></pre>

<p>Line 56 is $this->Flash->success(__('The user has been saved.'));</p>

<p>The user is inserted, updated or deleted from the database (depending on the requested action)</p>

<p>What is puzzling me is why would the code return an error and most important is, how could I solve this?</p>

<p>Thank you very much for your time.</p>