Add (checks)
This commit is contained in:
@@ -70,6 +70,7 @@ public function discover(Request $request, $category_slug = null)
|
|||||||
$ai_tools = AiTool::when(! is_null($category), function ($query) use ($category) {
|
$ai_tools = AiTool::when(! is_null($category), function ($query) use ($category) {
|
||||||
$query->where('category_id', $category->id);
|
$query->where('category_id', $category->id);
|
||||||
})
|
})
|
||||||
|
->whereNotNull('screenshot_img')
|
||||||
->orderBy('updated_at', 'DESC')->paginate(6);
|
->orderBy('updated_at', 'DESC')->paginate(6);
|
||||||
|
|
||||||
if ($ai_tools->count() <= 0) {
|
if ($ai_tools->count() <= 0) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class FrontHomeController extends Controller
|
|||||||
{
|
{
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$latest_ai_tools = AiTool::orderBy('created_at', 'DESC')->take(12)->get();
|
$latest_ai_tools = AiTool::orderBy('created_at', 'DESC')->whereNotNull('screenshot_img')->take(12)->get();
|
||||||
|
|
||||||
return view('front.home', compact('latest_ai_tools'));
|
return view('front.home', compact('latest_ai_tools'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,11 @@ public function show(Request $request, $ai_tool_slug)
|
|||||||
return abort(404);
|
return abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if (is_empty($ai_tool->screenshot_img))
|
||||||
|
// {
|
||||||
|
// return ;
|
||||||
|
// }
|
||||||
|
|
||||||
$ai_tool->load('category');
|
$ai_tool->load('category');
|
||||||
|
|
||||||
$breadcrumbs = collect([
|
$breadcrumbs = collect([
|
||||||
|
|||||||
Reference in New Issue
Block a user