title: CakePHP Base Table View not Found
body: <p>Thanks in Advance,</p>
  
  <p>When i run bellow Code its showing following error while i add a User.</p>
  
  <p><strong>SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bookstore.users' doesn't exist</strong></p>
  
  <p>I have user Controller in <code>\src\Controller\Admin\UsersController.php</code></p>
  
  <pre><code>&lt;?php
  namespace App\Controller\Admin;
  
  use Cake\Core\Configure;
  use Cake\Network\Exception\ForbiddenException;
  use Cake\Network\Exception\NotFoundException;
  use Cake\View\Exception\MissingTemplateException;
  use Cake\Event\Event;
  
  class UsersController extends AppController
  {
      public function beforeFilter(Event $event)
      {
          parent::beforeFilter($event);
          $this-&gt;loadModel('Admin/Users');
      }
  
      public function index()
      {
          $this-&gt;set('headerinfo', array('seoTitle' =&gt; 'Dash Board', 'pageTitle' =&gt; 'Dashboard', 'breadcrumbs' =&gt; null));
          $this-&gt;set('users', $this-&gt;Users-&gt;find('all'));
      }
  
      public function add()
      {
          $breadcrumbs = array(
              array('', 'Users')
          );
          $this-&gt;set('headerinfo', array('seoTitle' =&gt; 'Add User', 'pageTitle' =&gt; 'Add User', 'breadcrumbs' =&gt; null));
  
          $this-&gt;loadModel('Users');
          $user = $this-&gt;Users-&gt;newEntity();
  
          if ($this-&gt;request-&gt;is('post')) {
              $user = $this-&gt;Users-&gt;patchEntity($user, $this-&gt;request-&gt;getData());
              if ($this-&gt;Users-&gt;save($user)) {
                  $this-&gt;Flash-&gt;success(__('User inserted successfully.'));
                  return $this-&gt;redirect(['action' =&gt; 'add']);
              }
              $this-&gt;Flash-&gt;error(__('Unable to add the user, please contact support'));
          }
          $this-&gt;set('user', $user);
      }
  }
  </code></pre>
  
  <p>And Model for Users Table is in following file <code>\src\Model\Table\Admin\UsersTable.php</code></p>
  
  <pre><code>&lt;?php
  
  namespace App\Model\Table\Admin;
  
  use App\Model\Entity\Admin\User;
  use Cake\ORM\Table;
  use Cake\ORM\Query;
  use Cake\Routing\Router;
  use Cake\Validation\Validator;
  
  class UsersTable extends Table
  {
      public function initialize(array $config)
      {
          parent::initialize($config);
  
          $this-&gt;table('admin_users');
          $this-&gt;primaryKey('auID');
      }
  }
  </code></pre>
  
  <p>And Model for User Table's Entity is in following file <code>\src\Model\Entity\Admin\User.php</code></p>
  
  <pre><code>&lt;?php
  
  namespace App\Model\Entity\Admin;
  
  use Cake\ORM\Entity;
  use Cake\Auth\DefaultPasswordHasher;
  
  class User extends Entity {
  
      protected $_accessible = [
          '*' =&gt; true,
          'auID' =&gt; false,
      ];
  
      protected function _setAuPass($password){
          return (new DefaultPasswordHasher)-&gt;hash($password);
      }
  }
  </code></pre>
  
  <p>Table Structure:-</p>
  
  <pre><code>admin_users
  
  Column  Type    Null    Default Comments    MIME
  auID    int(11) No           
  auName  varchar(75) No           
  auPass  varchar(255)    No           
  auFullName  varchar(75) No           
  auStatus    varchar(2)  Yes     A   A=Active, I=Inactive     
  createdOn   datetime    Yes     NULL         
  modifiedOn  datetime    Yes     NULL         
  Indexes
  Keyname Type    Unique  Packed  Column  Cardinality Collation   Null    Comment
  PRIMARY BTREE   Yes No  auID    1   A   No  
  auName  BTREE   No  No  auName  1   A   No  
  auStatus    BTREE   No  No  auStatus    1   A   Yes 
  </code></pre>