Open sidebar
<?php //categories use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCategoriesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->string('model')->nullable(); $table->boolean('published')->default(false); $table->nestedSet(); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('categories'); } } //category_translations use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCategoryTranslationsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('category_translations', function (Blueprint $table) { $table->bigIncrements('id'); $table->bigInteger('category_id'); $table->string('locale')->nullable(); $table->string('title')->nullable(); $table->text('description')->nullable(); $table->timestamps(); $table->softDeletes(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('category_translations'); } }
Close sidebar
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting
Back
Please note that all pasted data is publicly available.
X (fomerly Twitter)
GitHub
Use setting