SEO Time
This commit is contained in:
@@ -11,14 +11,18 @@ use App\Http\Requests\StoreNewsRequest;
|
||||
use App\Jobs\DeleteXenForoCommentsThread;
|
||||
use App\Models\News;
|
||||
use App\Services\NewsService;
|
||||
use Artesaos\SEOTools\Facades\SEOTools;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class NewsController extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
SEOTools::setTitle('News');
|
||||
return view('news.index');
|
||||
}
|
||||
|
||||
@@ -43,6 +47,13 @@ class NewsController extends Controller
|
||||
|
||||
$comments = EntryHelpers::getLatestComments($news);
|
||||
|
||||
SEOTools::setTitle($news->title);
|
||||
SEOTools::setDescription( Str::limit( $news->description , 150 ) );
|
||||
SEOTools::opengraph()->addProperty('type', 'article');
|
||||
if( $news->gallery->first() ){
|
||||
SEOTools::opengraph()->addImage( url( Storage::url( $news->gallery->first()->image ) ) );
|
||||
}
|
||||
|
||||
return view('news.show', compact('news', 'comments'));
|
||||
}
|
||||
|
||||
@@ -54,6 +65,7 @@ class NewsController extends Controller
|
||||
'oldCategory' => old('category') ? [ old('category') ] : []
|
||||
];
|
||||
|
||||
SEOTools::setTitle('Submit News');
|
||||
return view ('news.create', $data);
|
||||
}
|
||||
|
||||
@@ -65,6 +77,7 @@ class NewsController extends Controller
|
||||
'oldCategory' => old('category', $news->category_id) ? [ old('category', $news->category_id) ] : []
|
||||
];
|
||||
|
||||
SEOTools::setTitle('Edit News');
|
||||
return view ('news.edit', $data);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user