Answers for "base table already exists laravel"

PHP
0

check table exists in db laravel

if (!Schema::hasTable('table_name')) {
    // Code to create table
}
Posted by: Guest on July-15-2020
0

laravel create table if not exists

if (!Schema::hasTable('tblCategory')) {
     Schema::create('tblCategory', function($table){
            $table->engine = 'InnoDB';
            $table->increments('CategoryID');
            $table->string('Category', 40);
            $table->unique('Category', 'tblCategory_UK_Category');
            $table->timestamps();
    }
}
Posted by: Guest on February-21-2022

Code answers related to "base table already exists laravel"

Browse Popular Code Answers by Language