Browse Source

fix pubblicazione se non pubblicato

FabioFratini 1 year ago
parent
commit
77806b7396
1 changed files with 1 additions and 1 deletions
  1. 1 1
      routes/web.php

+ 1 - 1
routes/web.php

@@ -3339,7 +3339,7 @@ Route::get('/{slug}', function ($slug) {
     $page = Page::where('slug', '=', $slug)->first();
     if ($page != null)
     {
-        $news = News::where('page_id', '=', $page->id)->orderBy('date', 'DESC')->first();
+        $news = News::where('page_id', '=', $page->id)->where('online', '=', true)->orderBy('date', 'DESC')->first();
 
         $aImages = array();
         if ($news)