@@ -3,12 +3,22 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Home;
|
||||
use Artesaos\SEOTools\Traits\SEOTools as SEOToolsTrait;
|
||||
|
||||
class PublicController extends Controller
|
||||
{
|
||||
use SEOToolsTrait;
|
||||
|
||||
public function show($slug)
|
||||
{
|
||||
$home = Home::where('slug', $slug)->firstOrFail();
|
||||
$this->seo()
|
||||
->setTitle($home->title)
|
||||
->setDescription($home->excerpt())
|
||||
->addImages(array_map(static function($picture) {
|
||||
return asset($picture);
|
||||
}, $home->pictures));
|
||||
|
||||
return view('public.view', ['home' => $home]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user