Update (config): enable canonical

Update (migration): Add category type
Add (admin): Add post cliffhanger
This commit is contained in:
2023-08-03 19:46:32 +08:00
parent 8d11ccf2de
commit 500714d7bf
41 changed files with 366 additions and 229 deletions

View File

@@ -80,6 +80,7 @@ public function postUpsert(Request $request)
'title' => $request->input('title'),
'slug' => $request->input('slug'),
'excerpt' => $request->input('excerpt'),
'cliffhanger' => $request->input('cliffhanger'),
'author_id' => intval($request->input('author_id', 1)),
'featured' => filter_var($request->input('featured'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE),
'featured_image' => $request->input('featured_image'),

View File

@@ -121,9 +121,19 @@ public function countryCategory(Request $request, $country, $category)
SEOTools::opengraph();
SEOTools::jsonLd();
$this_month = now()->format('F Y');
$country_name = get_country_name_by_iso($country_locale->country_iso);
SEOTools::setTitle("Top {$category->name} Reviews in {$country_name}");
//dd($category->type);
if ($category->type == 'review') {
SEOTools::setTitle("Top {$category->name} Reviews for {$this_month} in {$country_name}");
} elseif ($category->type == 'deals') {
SEOTools::setTitle("{$this_month} Latest Deals, Coupon Codes & Vouchers for {$country_name}");
} elseif ($category->type == 'launch') {
SEOTools::setTitle("New {$this_month} Product Launches in {$country_name}");
}
$category_name = strtolower($category->name);

View File

@@ -45,6 +45,7 @@ class Category extends Model
];
protected $fillable = [
'type',
'country_locale_id',
'name',
'short_name',

View File

@@ -49,6 +49,7 @@ class Post extends Model implements Feedable
protected $fillable = [
'title',
'slug',
'cliffhanger',
'excerpt',
'author_id',
'featured_image',