Add (checks)

This commit is contained in:
2023-11-28 16:04:03 +08:00
parent 44aba5b234
commit 3bb4a43d72
3 changed files with 7 additions and 1 deletions

View File

@@ -70,6 +70,7 @@ public function discover(Request $request, $category_slug = null)
$ai_tools = AiTool::when(! is_null($category), function ($query) use ($category) {
$query->where('category_id', $category->id);
})
->whereNotNull('screenshot_img')
->orderBy('updated_at', 'DESC')->paginate(6);
if ($ai_tools->count() <= 0) {

View File

@@ -13,7 +13,7 @@ class FrontHomeController extends Controller
{
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'));
}

View File

@@ -19,6 +19,11 @@ public function show(Request $request, $ai_tool_slug)
return abort(404);
}
// if (is_empty($ai_tool->screenshot_img))
// {
// return ;
// }
$ai_tool->load('category');
$breadcrumbs = collect([