title: Base table or view not found: 1146 Table 'Vojodb.users' doesn't exist
body: <p>I like to save data to database. But it showed an error <strong>SQLSTATE[42S02]: Base table or view not found: 1146 Table 'vojodb.users' doesn't exist (SQL: insert into <code>users</code> ** i had search in stackoverflow how to resolve my problem. i had try to add **public $table = "users"</strong> in User Model. But nothing happened. Please give me solution how to resolve this problem. </p>
  
  <p>this is my code</p>
  
  <p>//Register Controller</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers\Auth;
  
  use App\Models\User;
  use App\Models\Band;
  use App\Http\Controllers\Controller;
  use Illuminate\Http\Request;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Foundation\Auth\RegistersUsers;
  use Session;
  use File;
  
  class RegisterController extends Controller
  {
  /*
  |--------------------------------------------------------------------------
  | Register Controller
  |--------------------------------------------------------------------------
  |
  | This controller handles the registration of new users as well as their
  | validation and creation. By default this controller uses a trait to
  | provide this functionality without requiring any additional code.
  |
  */
  
  use RegistersUsers;
  
  /**
   * Where to redirect users after registration.
   *
   * @var string
   */
  protected $redirectTo = '/home';
  
  /**
   * Create a new controller instance.
   *
   * @return void
   */
  public function __construct()
  {
      $this-&gt;middleware('guest');
  }
  
  /**
   * Get a validator for an incoming registration request.
   *
   * @param  array  $data
   * @return \Illuminate\Contracts\Validation\Validator
   */
  protected function validator(array $data)
  {
      return Validator::make($data, [
          'name' =&gt; 'required|string|max:255',
          'email' =&gt; 'required|string|email|max:255|unique:users',
          'password' =&gt; 'required|string|min:6|confirmed',
      ]);
  }
  
  /**
   * Create a new user instance after a valid registration.
   *
   * @param  array  $data
   * @return \App\User
   */
  protected function create(array $data, Request $request)
  {
  
  }
  protected function show(){
      return view('auth.register');
  }
  
  protected function savesession(Request $request){
      Session::put('SimpanNamaBand',$request-&gt;input('senderName'));
      Session::put('SimpanEmailBand',$request-&gt;input('senderEmail'));
      Session::put('SimpanUserBand',$request-&gt;input('senderUsername'));
      Session::put('SimpanPasswordBand',$request-&gt;input('senderPassword'));
  
  
  }
  protected function savesessiondua(Request $request){
      Session::put('SimpanKotaBand',$request-&gt;input('senderCity'));
      Session::put('SimpanTanggalBand',$request-&gt;input('senderFormedDate'));
      Session::put('SimpanGenreBand',$request-&gt;input('senderGenre'));
      Session::put('SimpanWebsiteBand',$request-&gt;input('senderWebsite'));
      Session::put('SimpanContactBand',$request-&gt;input('senderContact'));
  
  
  }
  
  protected function lastsession(Request $request)
  {
      Session::put('SimpanTypeBand', $request-&gt;input('soundsLike'));
  }
  
  protected function showform(){
  
      return view('auth.registertwo');
      //return view('auth.registerv');
  }
  protected function showformfinal(){
      //$print = Session::get('SaveRegister');
      return view('auth.final');
      //return view('auth.registerv');
  }
  
  protected function showformverification(){
      return view('auth.verify');
  }
  
  protected function test(){
      if(Session::has('SimpanNamaBand')){
          $value = Session::get('SimpanNamaBand');
          var_dump($value);
      }
  }
  protected function store(Request $request){
      $user = new User;
      $user-&gt;username = Session::get('SimpanUserBand');
      $user-&gt;password = bcrypt(Session::get('SimpanPasswordBand'));
      $user-&gt;email = Session::get('SimpanEmailBand');
      $user-&gt;name = Session::get('SimpanNamaBand');
      $user-&gt;user_type = 'band';
  
      $user-&gt;save();
  
      $band = new Band;
      $band-&gt;city = Session::get('SimpanCityBand');
      $band-&gt;formed_date = Session::get('SimpanTanggalBand');
      $band-&gt;genre = Session::get('SimpanGenreBand');
      $band-&gt;website = Session::get('SimpanWebsiteBand');
      $band-&gt;contact = Session::get('SimpanContactBand');
      $band-&gt;sounds_like = Session::get('SimpanTypeBand');
  
      if(!$request-&gt;hasFile('verify_file') &amp;&amp; !$request-&gt;file('verify_file')-&gt;isValid()) {
          return abort(404, 'File not uploaded!');
      }
  
      $filename = $request-&gt;session()-&gt;get('SimpanNamaBand');
      $request-&gt;image-&gt;move(base_path('public/' .$request-&gt;session()-&gt;get("SimpanNamaBan"). '/document'), $filename);
  
  
      $band-&gt;verification_file = $filename;
      $band-&gt;save();
      return response()-&gt;json(['Data berhasil di simpan']);
  
  }
  }
  </code></pre>
  
  <p>//users migration</p>
  
  <pre><code>&lt;?php
  
  use Illuminate\Support\Facades\Schema;
  use Illuminate\Database\Schema\Blueprint;
  use Illuminate\Database\Migrations\Migration;
  
  class CreateUsersTable extends Migration
  {
  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
      Schema::create('users', function (Blueprint $table) {
          $table-&gt;increments('id');
          $table-&gt;string('username');
          $table-&gt;string('password');
          $table-&gt;string('email')-&gt;unique();
          $table-&gt;string('name');
          $table-&gt;enum('user_type', ['customer', 'band', 'admin'])-&gt;default('customer');
          $table-&gt;string('profile_picture')-&gt;nullable();
          $table-&gt;datetime('last_login')-&gt;nullable();
          $table-&gt;rememberToken();
          $table-&gt;timestamps();
      });
  }
  
  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
      Schema::dropIfExists('users');
  }
  }
  </code></pre>
  
  <p>//User model</p>
  
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Notifications\Notifiable;
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
  use Notifiable;
  
  /**
   * The attributes that are mass assignable.
   *
   * @var array
   */
  protected $fillable = [
      'name', 'email', 'password','username'
  ];
  
  /**
   * The attributes that should be hidden for arrays.
   *
   * @var array
   */
  protected $hidden = [
      'password', 'remember_token',
  ];
  
  protected $table = "users";
  
  // Ambil data dari field yang bersangkutan
  public function detail() {
      return $this-&gt;hasOne('App\Models\\'.ucfirst($this-&gt;user_type));
  }
  }
  </code></pre>
  
  <p>//Band model</p>
  
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Band extends Model
  {
  protected $primaryKey = 'user_id';
  public $incrementing  = false;
  
  public function user() {
      return $this-&gt;belongsTo(User::class);
  }
  }
  </code></pre>
  
  <p>i used <strong>php artisan make:auth</strong> but i modify the controller as i need. Is it possible caused the error? Thank You.</p>