Browse Source

Articles database table

axkuhta 1 year ago
parent
commit
72eaddc91b

+ 2 - 2
app/Models/Article.php

@@ -2,10 +2,10 @@
 
 namespace App\Models;
 
-use Illuminate\Database\Eloquent\Factories\HasFactory;
 use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\SoftDeletes;
 
 class Article extends Model
 {
-    use HasFactory;
+	use SoftDeletes;
 }

+ 6 - 0
database/migrations/2023_12_02_171900_create_articles_table.php

@@ -14,6 +14,12 @@ return new class extends Migration
         Schema::create('articles', function (Blueprint $table) {
             $table->id();
             $table->timestamps();
+            $table->softDeletes();
+            $table->string("title");
+            $table->text("content");
+            $table->timestamp("published_at");
+            $table->timestamp("unpublished_at");
+            $table->tinyInteger("status")->unsigned()->default(0);
         });
     }