Sync
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
namespace App\Http\Controllers\Front;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\AiTool;
|
||||
use App\Models\Category;
|
||||
use Artesaos\SEOTools\Facades\SEOMeta;
|
||||
use Artesaos\SEOTools\Facades\SEOTools;
|
||||
use Illuminate\Http\Request;
|
||||
use JsonLd\Context;
|
||||
@@ -36,7 +38,7 @@ public function discover(Request $request, $category_slug = null)
|
||||
SEOTools::opengraph();
|
||||
SEOTools::jsonLd();
|
||||
SEOTools::setTitle($category->name.' AI Tools', false);
|
||||
//SEOTools::setDescription($description);
|
||||
//SEOTools::setDescription($description);
|
||||
} else {
|
||||
$breadcrumbs = collect([
|
||||
['name' => 'Home', 'url' => route('front.home')],
|
||||
@@ -65,6 +67,15 @@ public function discover(Request $request, $category_slug = null)
|
||||
'itemListElement' => $listItems,
|
||||
]);
|
||||
|
||||
return view('front.discover', compact('breadcrumbs', 'breadcrumb_context', 'category'));
|
||||
$ai_tools = AiTool::when(! is_null($category), function ($query) use ($category) {
|
||||
$query->where('category_id', $category->id);
|
||||
})
|
||||
->orderBy('updated_at', 'DESC')->paginate(6);
|
||||
|
||||
if ($ai_tools->count() <= 0) {
|
||||
SEOMeta::setRobots('noindex');
|
||||
}
|
||||
|
||||
return view('front.discover', compact('breadcrumbs', 'breadcrumb_context', 'category', 'ai_tools'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user