This commit is contained in:
2023-11-26 18:56:40 +08:00
parent be14f5fdb1
commit 64431e7a73
144 changed files with 497072 additions and 3730 deletions

View File

@@ -0,0 +1,70 @@
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use App\Models\Category;
use Artesaos\SEOTools\Facades\SEOTools;
use Illuminate\Http\Request;
use JsonLd\Context;
class FrontDiscoverController extends Controller
{
public function discover(Request $request, $category_slug = null)
{
$tools_count = round_to_nearest_base(700);
$category = null;
if (! is_empty($category_slug)) {
$category = Category::where('slug', $category_slug)->first();
if (is_null($category)) {
return abort(404);
}
}
if (! is_null($category)) {
$breadcrumbs = collect([
['name' => 'Home', 'url' => route('front.home')],
['name' => 'Discover AI Tools', 'url' => route('front.discover.home')],
['name' => $category->name.' AI Tools', 'url' => null],
]);
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
SEOTools::jsonLd();
SEOTools::setTitle($category->name.' AI Tools', false);
//SEOTools::setDescription($description);
} else {
$breadcrumbs = collect([
['name' => 'Home', 'url' => route('front.home')],
['name' => 'Discover AI Tools', 'url' => null],
]);
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
SEOTools::jsonLd();
SEOTools::setTitle("{$tools_count} over AI Tools for you", false);
//SEOTools::setDescription($description);
}
// breadcrumb json ld
$listItems = [];
foreach ($breadcrumbs as $index => $breadcrumb) {
$listItems[] = [
'name' => $breadcrumb['name'],
'url' => $breadcrumb['url'],
];
}
$breadcrumb_context = Context::create('breadcrumb_list', [
'itemListElement' => $listItems,
]);
return view('front.discover', compact('breadcrumbs', 'breadcrumb_context', 'category'));
}
}

View File

@@ -0,0 +1,83 @@
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use Artesaos\SEOTools\Facades\SEOMeta;
use Artesaos\SEOTools\Facades\SEOTools;
use GrahamCampbell\Markdown\Facades\Markdown;
use Illuminate\Http\Request;
class FrontHomeController extends Controller
{
public function index(Request $request)
{
return view('front.home');
}
public function terms(Request $request)
{
$markdown = file_get_contents(resource_path('markdown/terms.md'));
$title = 'Terms of Service';
$description = 'Our Terms of Service outline your rights, responsibilities, and the standards we uphold for a seamless experience.';
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
SEOTools::jsonLd();
SEOTools::setTitle($title);
SEOTools::setDescription($description);
SEOMeta::setRobots('noindex');
$content = Markdown::convert($markdown)->getContent();
//$content = $this->injectTailwindClasses($content);
return view('front.pages', compact('content', 'title', 'description'));
}
public function privacy(Request $request)
{
$markdown = file_get_contents(resource_path('markdown/privacy.md'));
$title = 'Privacy Policy';
$description = 'Our Privacy Policy provides clarity about the data we collect and how we use it, ensuring your peace of mind.';
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
SEOTools::jsonLd();
SEOTools::setTitle($title);
SEOTools::setDescription($description);
SEOMeta::setRobots('noindex');
$content = Markdown::convert($markdown)->getContent();
//$content = $this->injectTailwindClasses($content);
return view('front.pages', compact('content', 'title', 'description'));
}
public function disclaimer(Request $request)
{
$markdown = file_get_contents(resource_path('markdown/disclaimer.md'));
$title = 'Disclaimer';
$description = 'AI Buddy Tool provides the content on this website purely for informational purposes and should not be interpreted as legal, financial, or medical guidance.';
SEOTools::metatags();
SEOTools::twitter();
SEOTools::opengraph();
SEOTools::jsonLd();
SEOTools::setTitle($title);
SEOTools::setDescription($description);
SEOMeta::setRobots('noindex');
$content = Markdown::convert($markdown)->getContent();
//$content = $this->injectTailwindClasses($content);
return view('front.pages', compact('content', 'title', 'description'));
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
class FrontSearchController extends Controller
{
//
}

View File

@@ -1,14 +0,0 @@
<?php
namespace App\Http\Controllers\Front;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
class HomeController extends Controller
{
public function index(Request $request)
{
return view('front.home');
}
}