title: Laravel error: SQLSTATE[42S02]: Base table or view not found
body: <p>The full error: </p>
  
  <pre><code>SQLSTATE[42S02]: Base table or view not found: 1146 Table 'quotesapp.admin' doesn't exist (SQL: select count(*) as aggregate from `admin` where `username` = Admin)
  </code></pre>
  
  <p>I know the error is the mismatch between the name as it appears in the error log and how it's defined everywhere else (in the database folder, but I am unable to solve the problem. I searched around and found <a href="https://stackoverflow.com/questions/30159257/base-table-or-view-not-found-1146-table-laravel-5">this</a> post, but even after I implemented the solution(shown below), I keep getting the same error. </p>
  
  <p>I am using Laravel 5.2. I have an <code>admins</code> table in my database directory which looks like this: </p>
  
  <pre><code>class CreateAdminsTable extends Migration
  {
  
      public function up()
      {
          Schema::create('admins', function (Blueprint $table) {
              $table-&gt;increments('id');
              $table-&gt;timestamps();
              $table-&gt;string('username')-&gt;unique();
              $table-&gt;string('password');
              $table-&gt;rememberToken();
          });
      }
  
      public function down()
      {
          Schema::drop('admins');
      }
  }
  </code></pre>
  
  <p>The Admin model looks like this :</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Auth\Authenticatable; 
  
  class Admin extends Model implements \Illuminate\Contracts\Auth\Authenticatable
  {
      protected $table = 'admins';
      use Authenticatable;
  }
  
  ?&gt;
  </code></pre>
  
  <p>Here is the relevant route that is causing the error to be thrown: </p>
  
  <pre><code>Route::post('/admin/register', [
      'uses' =&gt; 'AdminController@postRegister',
      'as' =&gt; 'register'
  ]);
  </code></pre>
  
  <p>And here is the <code>postRegister</code> method </p>
  
  <pre><code> public function postRegister(Request $request) {
  
      $this-&gt;validate($request, [
          'username' =&gt; 'required|unique:admin|max:30|min:3',
          'password' =&gt; 'required|min:5',
          'password_confirm' =&gt; 'required'           
      ]);
  
      $password = $request['password'];
      $passwordConfirm = $request['password_confirm'];
  
      if ($password !== $passwordConfirm) {
          return redirect()-&gt;back()-&gt;with(['fail' =&gt; 'password fields do not match!']);
      }
  
      $admin = new Admin();
      $admin-&gt;username = $request['username'];
      $admin-&gt;password = $request['password'];
      $admin-&gt;save();
  
      return redirect()-&gt;route('index');       
  
  }
  </code></pre>
  
  <p>I have run <code>php artisan migrate</code> in composer, but I get the "nothing to migrate" response. I have tried refreshing the database via composer, but to no avail. The table 'admins' is showing up in phpmyadmin. </p>
  
  <p><strong>Update 1:</strong> Added full error message</p>