Answers for "laravel where not exist in other table"

PHP
0

laravel migrate 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 June-16-2021
0

create if not exist laravel

if(!Numbers::where('country',$country)->exists()){
    Numbers::Create([
      'country'    => $country
      ]);
}
Posted by: Guest on July-08-2021

Code answers related to "laravel where not exist in other table"

Browse Popular Code Answers by Language