File: /home/jubaroyal/public_html/database/migrations/2023_04_09_201820_create_blogs_table.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('blogs', function (Blueprint $table) {
$table->id();
$table->string('date')->nullable();
$table->integer('blog_category_id')->nullable();
$table->text('title')->nullable();
$table->text('slug')->nullable();
$table->text('description')->nullable();
$table->text('comment')->nullable();
$table->integer('views')->nullable();
$table->integer('is_sharable')->nullable();
$table->integer('is_commentable')->nullable();
$table->integer('to_subscribers')->nullable();
$table->string('photo')->nullable();
$table->integer('created_by')->nullable();
$table->integer('updated_by')->nullable();
$table->string('status')->default('Unpublished');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('blogs');
}
};