Explorar o código

Run article publish/takedown on schedule

Also fix a typo
axkuhta hai 1 ano
pai
achega
c402d49e0c
Modificáronse 2 ficheiros con 2 adicións e 1 borrados
  1. 1 0
      app/Console/Kernel.php
  2. 1 1
      app/Models/Article.php

+ 1 - 0
app/Console/Kernel.php

@@ -13,6 +13,7 @@ class Kernel extends ConsoleKernel
     protected function schedule(Schedule $schedule): void
     {
         // $schedule->command('inspire')->hourly();
+        $schedule->command("app:publish-scheduled-articles")->everyMinute();
     }
 
     /**

+ 1 - 1
app/Models/Article.php

@@ -38,7 +38,7 @@ class Article extends Model
 	}
 
 	function unpublish() {
-		$this->status = static::STATUS_ARCHIVED;
+		$this->status = static::STATUS_ARCHIVE;
 		$this->save();
 	}
 }