Add (post manage)
Add (post country viewing)
This commit is contained in:
2
FORMATTER.md
Normal file
2
FORMATTER.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
shufo: blade-formatter --write resources/\*_/_.blade.php
|
||||||
|
pint: ./vendor/bin/pint
|
||||||
@@ -46,18 +46,16 @@ function get_country_name_by_iso($country_iso)
|
|||||||
$country_iso = strtoupper($country_iso);
|
$country_iso = strtoupper($country_iso);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return config("platform.country_codes.{$country_iso}")['name'];
|
return config("platform.country_codes.{$country_iso}")['name'];
|
||||||
|
} catch (\Exception $e) {
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'International';
|
return 'International';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (! function_exists('get_country_emoji_by_iso')) {
|
if (! function_exists('get_country_emoji_by_iso')) {
|
||||||
function get_country_emoji_by_iso($country_iso)
|
function get_country_emoji_by_iso($country_iso)
|
||||||
{
|
{
|
||||||
@@ -66,11 +64,10 @@ function get_country_emoji_by_iso($country_iso)
|
|||||||
$country_iso = strtoupper($country_iso);
|
$country_iso = strtoupper($country_iso);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return config("platform.country_codes.{$country_iso}")['emoji'];
|
return config("platform.country_codes.{$country_iso}")['emoji'];
|
||||||
|
} catch (\Exception $e) {
|
||||||
}
|
}
|
||||||
catch (\Exception $e) {}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return '🌎';
|
return '🌎';
|
||||||
@@ -82,4 +79,4 @@ function str_random($length = 10)
|
|||||||
{
|
{
|
||||||
return Str::random($length);
|
return Str::random($length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public function __construct()
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('admin.home');
|
return redirect()->route('posts.manage');
|
||||||
|
//return view('admin.home');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
27
app/Http/Controllers/Admin/PostController.php
Normal file
27
app/Http/Controllers/Admin/PostController.php
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\Post;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class PostController extends Controller
|
||||||
|
{
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
$posts = Post::with('post_categories.category.country_locale')->orderBy('created_at', 'desc')->paginate();
|
||||||
|
|
||||||
|
return view('admin.posts.manage', compact('posts'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function new(Request $request)
|
||||||
|
{
|
||||||
|
return 'PostController@new';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function edit(Request $request, $post_id)
|
||||||
|
{
|
||||||
|
return 'PostController@edit : '.$post_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,9 +8,6 @@
|
|||||||
use App\Models\Post;
|
use App\Models\Post;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
use Stevebauman\Location\Facades\Location;
|
|
||||||
|
|
||||||
|
|
||||||
class HomeController extends Controller
|
class HomeController extends Controller
|
||||||
{
|
{
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
@@ -25,37 +22,35 @@ public function country(Request $request, $country)
|
|||||||
$country_locale = CountryLocale::where('slug', $country)->first();
|
$country_locale = CountryLocale::where('slug', $country)->first();
|
||||||
|
|
||||||
if (! is_null($country_locale)) {
|
if (! is_null($country_locale)) {
|
||||||
|
|
||||||
$request->session()->put('view_country_locale', $country_locale);
|
$request->session()->put('view_country_locale', $country_locale);
|
||||||
|
|
||||||
$featured_posts = Post::select('posts.*')
|
$featured_posts = Post::select('posts.*')
|
||||||
->join('post_categories','posts.id','=', 'post_categories.post_id')
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
->join('categories','post_categories.category_id','=', 'categories.id')
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
->whereNotNull('post_categories.id')
|
->whereNotNull('post_categories.id')
|
||||||
->whereNotNull('categories.id')
|
->whereNotNull('categories.id')
|
||||||
->where('categories.country_locale_slug', $country_locale->slug)
|
->where('categories.country_locale_slug', $country_locale->slug)
|
||||||
->where('posts.featured', true)
|
->where('posts.featured', true)
|
||||||
->where('posts.status', 'publish')
|
->where('posts.status', 'publish')
|
||||||
->orderBy('posts.updated_at', 'desc')
|
->orderBy('posts.updated_at', 'desc')
|
||||||
->take(3)
|
->take(3)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
|
|
||||||
$latest_posts = Post::select('posts.*')
|
$latest_posts = Post::select('posts.*')
|
||||||
->join('post_categories','posts.id','=', 'post_categories.post_id')
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
->join('categories','post_categories.category_id','=', 'categories.id')
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
->whereNotNull('post_categories.id')
|
->whereNotNull('post_categories.id')
|
||||||
->whereNotNull('categories.id')
|
->whereNotNull('categories.id')
|
||||||
->where('categories.country_locale_slug', $country_locale->slug)
|
->where('categories.country_locale_slug', $country_locale->slug)
|
||||||
->where('posts.featured', true)
|
->whereNotIn('posts.id', $featured_posts->pluck('id')->toArray())
|
||||||
->whereNotIn('posts.id', $featured_posts->pluck('id')->toArray())
|
->where('posts.status', 'publish')
|
||||||
->where('posts.status', 'publish')
|
->orderBy('posts.updated_at', 'desc')
|
||||||
->orderBy('posts.updated_at', 'desc')
|
->distinct()
|
||||||
->distinct()
|
->take(10)
|
||||||
->take(20)
|
->get();
|
||||||
->get();
|
|
||||||
|
|
||||||
return view('front.country', compact('country_locale','featured_posts','latest_posts')
|
return view('front.country', compact('country_locale', 'featured_posts', 'latest_posts')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -67,32 +62,57 @@ public function countryCategory(Request $request, $country, $category)
|
|||||||
$country_locale = CountryLocale::where('slug', $country)->first();
|
$country_locale = CountryLocale::where('slug', $country)->first();
|
||||||
|
|
||||||
if (is_null($country_locale)) {
|
if (is_null($country_locale)) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
$category = Category::where('slug', $category)->where('enabled', true)->first();
|
$category = Category::where('slug', $category)->where('enabled', true)->first();
|
||||||
|
|
||||||
if (is_null($category))
|
if (is_null($category)) {
|
||||||
{
|
abort(404);
|
||||||
abort(404);
|
}
|
||||||
}
|
|
||||||
return view('front.country_category', ['country_locale' => $country_locale, 'category' => $category]);
|
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||||
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
|
->whereNotNull('post_categories.id')
|
||||||
|
->whereNotNull('categories.id')
|
||||||
|
->where('categories.country_locale_slug', $country_locale->slug)
|
||||||
|
->where('categories.id', $category->id)
|
||||||
|
->where('posts.status', 'publish')
|
||||||
|
->orderBy('posts.updated_at', 'desc')
|
||||||
|
->distinct()
|
||||||
|
->paginate(15);
|
||||||
|
|
||||||
|
return view('front.country_category', compact('country_locale', 'category', 'latest_posts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function all(Request $request, $country)
|
public function all(Request $request, $country)
|
||||||
{
|
{
|
||||||
$country_locale = CountryLocale::where('slug', $country)->first();
|
$country_locale = CountryLocale::where('slug', $country)->first();
|
||||||
|
|
||||||
return view('front.country_all', ['country_locale' => $country_locale]);
|
$latest_posts = Post::with('post_categories')->select('posts.*')
|
||||||
|
->join('post_categories', 'posts.id', '=', 'post_categories.post_id')
|
||||||
|
->join('categories', 'post_categories.category_id', '=', 'categories.id')
|
||||||
|
->whereNotNull('post_categories.id')
|
||||||
|
->whereNotNull('categories.id')
|
||||||
|
->where('categories.country_locale_slug', $country_locale->slug)
|
||||||
|
->where('posts.status', 'publish')
|
||||||
|
->orderBy('posts.updated_at', 'desc')
|
||||||
|
->distinct()
|
||||||
|
->paginate(15);
|
||||||
|
|
||||||
|
return view('front.country_all', compact('country_locale', 'latest_posts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function posts(Request $request, $country)
|
public function post(Request $request, $country, $post_slug)
|
||||||
{
|
{
|
||||||
return "{$country} : all posts";
|
$post = Post::where('slug', $post_slug)->where('status', 'publish')->first();
|
||||||
}
|
|
||||||
|
if (! is_null($post)) {
|
||||||
|
|
||||||
|
return view('front.post', compact('post'));
|
||||||
|
}
|
||||||
|
abort(404);
|
||||||
|
|
||||||
public function post(Request $request, $country, $post)
|
|
||||||
{
|
|
||||||
return "{$country} : {$post}";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,8 @@
|
|||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
|
||||||
use Stevebauman\Location\Facades\Location;
|
|
||||||
|
|
||||||
use Galahad\TimezoneMapper\Facades\TimezoneMapper;
|
use Galahad\TimezoneMapper\Facades\TimezoneMapper;
|
||||||
|
use Stevebauman\Location\Facades\Location;
|
||||||
|
|
||||||
class StoreGeoSession
|
class StoreGeoSession
|
||||||
{
|
{
|
||||||
@@ -14,7 +12,6 @@ class StoreGeoSession
|
|||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
* @param \Illuminate\Http\Request $request
|
* @param \Illuminate\Http\Request $request
|
||||||
* @param \Closure $next
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
@@ -34,28 +31,23 @@ public function handle($request, Closure $next)
|
|||||||
$needs_update = true;
|
$needs_update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$request->session()->has('timezone')) {
|
if (! $request->session()->has('timezone')) {
|
||||||
$needs_update = true;
|
$needs_update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($needs_update)
|
if ($needs_update) {
|
||||||
{
|
|
||||||
|
|
||||||
if ($payload = Location::get($ip))
|
if ($payload = Location::get($ip)) {
|
||||||
{
|
$request->session()->put('geodata', base64_encode(json_encode($payload)));
|
||||||
$request->session()->put('geodata', base64_encode(json_encode($payload)));
|
$isocode = $payload->isoCode;
|
||||||
$isocode = $payload->isoCode;
|
} else {
|
||||||
}
|
$isocode = '*';
|
||||||
else
|
|
||||||
{
|
|
||||||
$isocode = '*';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$request->session()->put('country', $isocode);
|
$request->session()->put('country', $isocode);
|
||||||
|
|
||||||
if (isset($payload->latitude) && isset($payload->longitude))
|
if (isset($payload->latitude) && isset($payload->longitude)) {
|
||||||
{
|
$request->session()->put('timezone', TimezoneMapper::mapCoordinates($payload->latitude, $payload->longitude));
|
||||||
$request->session()->put('timezone', TimezoneMapper::mapCoordinates($payload->latitude, $payload->longitude));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Author
|
* Class Author
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string $name
|
* @property string $name
|
||||||
* @property string $avatar
|
* @property string $avatar
|
||||||
@@ -21,30 +21,27 @@
|
|||||||
* @property bool $public
|
* @property bool $public
|
||||||
* @property Carbon|null $created_at
|
* @property Carbon|null $created_at
|
||||||
* @property Carbon|null $updated_at
|
* @property Carbon|null $updated_at
|
||||||
*
|
|
||||||
* @property Collection|Post[] $posts
|
* @property Collection|Post[] $posts
|
||||||
*
|
|
||||||
* @package App\Models
|
|
||||||
*/
|
*/
|
||||||
class Author extends Model
|
class Author extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'authors';
|
protected $table = 'authors';
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'enabled' => 'bool',
|
'enabled' => 'bool',
|
||||||
'public' => 'bool'
|
'public' => 'bool',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name',
|
'name',
|
||||||
'avatar',
|
'avatar',
|
||||||
'bio',
|
'bio',
|
||||||
'enabled',
|
'enabled',
|
||||||
'public'
|
'public',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function posts()
|
public function posts()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Post::class);
|
return $this->hasMany(Post::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Category
|
* Class Category
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use GeneaLabs\LaravelModelCaching\Traits\Cachable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CountryLocale
|
* Class CountryLocale
|
||||||
|
|||||||
@@ -6,13 +6,14 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use AlAminFirdows\LaravelEditorJs\Facades\LaravelEditorJs;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Post
|
* Class Post
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $title
|
* @property string|null $title
|
||||||
* @property string|null $slug
|
* @property string|null $slug
|
||||||
@@ -27,44 +28,60 @@
|
|||||||
* @property string $status
|
* @property string $status
|
||||||
* @property Carbon|null $created_at
|
* @property Carbon|null $created_at
|
||||||
* @property Carbon|null $updated_at
|
* @property Carbon|null $updated_at
|
||||||
*
|
|
||||||
* @property Author|null $author
|
* @property Author|null $author
|
||||||
* @property Collection|PostCategory[] $post_categories
|
* @property Collection|PostCategory[] $post_categories
|
||||||
*
|
|
||||||
* @package App\Models
|
|
||||||
*/
|
*/
|
||||||
class Post extends Model
|
class Post extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'posts';
|
protected $table = 'posts';
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'author_id' => 'int',
|
'author_id' => 'int',
|
||||||
'body' => 'json',
|
'body' => 'json',
|
||||||
'comment_count' => 'int',
|
'comment_count' => 'int',
|
||||||
'likes_count' => 'int'
|
'likes_count' => 'int',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'title',
|
'title',
|
||||||
'slug',
|
'slug',
|
||||||
'excerpt',
|
'excerpt',
|
||||||
'author_id',
|
'author_id',
|
||||||
'featured_image',
|
'featured_image',
|
||||||
'editor',
|
'editor',
|
||||||
'body',
|
'body',
|
||||||
'post_format',
|
'post_format',
|
||||||
'comment_count',
|
'comment_count',
|
||||||
'likes_count',
|
'likes_count',
|
||||||
'status'
|
'status',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function author()
|
protected $appends = [
|
||||||
{
|
'html_body',
|
||||||
return $this->belongsTo(Author::class);
|
];
|
||||||
}
|
|
||||||
|
|
||||||
public function post_categories()
|
public function author()
|
||||||
{
|
{
|
||||||
return $this->hasMany(PostCategory::class);
|
return $this->belongsTo(Author::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function post_categories()
|
||||||
|
{
|
||||||
|
return $this->hasMany(PostCategory::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function post_category()
|
||||||
|
{
|
||||||
|
return $this->hasOne(PostCategory::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getHtmlBodyAttribute()
|
||||||
|
{
|
||||||
|
if (! is_empty($this->body)) {
|
||||||
|
return LaravelEditorJs::render($this->body);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,39 +11,36 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PostCategory
|
* Class PostCategory
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $post_id
|
* @property int $post_id
|
||||||
* @property int $category_id
|
* @property int $category_id
|
||||||
* @property Carbon|null $created_at
|
* @property Carbon|null $created_at
|
||||||
* @property Carbon|null $updated_at
|
* @property Carbon|null $updated_at
|
||||||
*
|
|
||||||
* @property Category $category
|
* @property Category $category
|
||||||
* @property Post $post
|
* @property Post $post
|
||||||
*
|
|
||||||
* @package App\Models
|
|
||||||
*/
|
*/
|
||||||
class PostCategory extends Model
|
class PostCategory extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'post_categories';
|
protected $table = 'post_categories';
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'post_id' => 'int',
|
'post_id' => 'int',
|
||||||
'category_id' => 'int'
|
'category_id' => 'int',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'post_id',
|
'post_id',
|
||||||
'category_id'
|
'category_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function category()
|
public function category()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Category::class);
|
return $this->belongsTo(Category::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function post()
|
public function post()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Post::class);
|
return $this->belongsTo(Post::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,6 @@ public function register()
|
|||||||
*/
|
*/
|
||||||
public function boot()
|
public function boot()
|
||||||
{
|
{
|
||||||
Paginator::useBootstrap();
|
Paginator::useBootstrapFive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
|
|
||||||
use App\View\Composers\CategoryComposer;
|
use App\View\Composers\CategoryComposer;
|
||||||
use App\View\Composers\CountryLocaleComposer;
|
use App\View\Composers\CountryLocaleComposer;
|
||||||
|
|
||||||
|
|
||||||
use Illuminate\Support\Facades\View;
|
use Illuminate\Support\Facades\View;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
@@ -35,12 +33,9 @@ public function boot()
|
|||||||
View::composer('layouts.front.footer', CategoryComposer::class);
|
View::composer('layouts.front.footer', CategoryComposer::class);
|
||||||
View::composer('layouts.front.footer', CountryLocaleComposer::class);
|
View::composer('layouts.front.footer', CountryLocaleComposer::class);
|
||||||
|
|
||||||
if (auth()->check())
|
if (auth()->check()) {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use PharData;
|
use PharData;
|
||||||
use PharFileInfo;
|
use PharFileInfo;
|
||||||
use Stevebauman\Location\Position;
|
|
||||||
use Stevebauman\Location\Request;
|
|
||||||
use Stevebauman\Location\Drivers\Driver;
|
use Stevebauman\Location\Drivers\Driver;
|
||||||
use Stevebauman\Location\Drivers\Updatable;
|
use Stevebauman\Location\Drivers\Updatable;
|
||||||
|
use Stevebauman\Location\Position;
|
||||||
|
use Stevebauman\Location\Request;
|
||||||
|
|
||||||
class MaxMindDriver extends Driver implements Updatable
|
class MaxMindDriver extends Driver implements Updatable
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,25 +2,23 @@
|
|||||||
|
|
||||||
namespace App\View\Composers;
|
namespace App\View\Composers;
|
||||||
|
|
||||||
use App\Models\CountryLocale;
|
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
|
use App\Models\CountryLocale;
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class CategoryComposer
|
class CategoryComposer
|
||||||
{
|
{
|
||||||
public function compose(View $view)
|
public function compose(View $view)
|
||||||
{
|
{
|
||||||
$current_country_locale = request()->session()->get('view_country_locale');
|
$current_country_locale = request()->session()->get('view_country_locale');
|
||||||
|
|
||||||
if (is_null($current_country_locale))
|
if (is_null($current_country_locale)) {
|
||||||
{
|
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
||||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$categories = Category::where('country_locale_id', $current_country_locale->id)->get();
|
$categories = Category::where('country_locale_id', $current_country_locale->id)->get();
|
||||||
|
|
||||||
$view->with('categories', $categories);
|
$view->with('categories', $categories);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,27 +3,23 @@
|
|||||||
namespace App\View\Composers;
|
namespace App\View\Composers;
|
||||||
|
|
||||||
use App\Models\CountryLocale;
|
use App\Models\CountryLocale;
|
||||||
|
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class CountryLocaleComposer
|
class CountryLocaleComposer
|
||||||
{
|
{
|
||||||
public function compose(View $view)
|
public function compose(View $view)
|
||||||
{
|
{
|
||||||
$country_locales = CountryLocale::all();
|
$country_locales = CountryLocale::all();
|
||||||
|
|
||||||
$current_country_locale = null;
|
$current_country_locale = null;
|
||||||
|
|
||||||
if (!is_null(request()->session()->get('view_country_locale')))
|
if (! is_null(request()->session()->get('view_country_locale'))) {
|
||||||
{
|
$current_country_locale = request()->session()->get('view_country_locale');
|
||||||
$current_country_locale = request()->session()->get('view_country_locale');
|
} else {
|
||||||
}
|
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
||||||
else
|
}
|
||||||
{
|
|
||||||
$current_country_locale = CountryLocale::where('slug', config('platform.general.fallback_country_slug'))->first();
|
|
||||||
}
|
|
||||||
|
|
||||||
$view->with('country_locales', $country_locales)
|
$view->with('country_locales', $country_locales)
|
||||||
->with('current_country_locale', $current_country_locale);
|
->with('current_country_locale', $current_country_locale);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.1",
|
||||||
|
"alaminfirdows/laravel-editorjs": "^2.0",
|
||||||
"artesaos/seotools": "^1.2",
|
"artesaos/seotools": "^1.2",
|
||||||
|
"codex-team/editor.js": "^2.0",
|
||||||
"genealabs/laravel-model-caching": "^0.13.4",
|
"genealabs/laravel-model-caching": "^0.13.4",
|
||||||
"glhd/laravel-timezone-mapper": "^1.4",
|
"glhd/laravel-timezone-mapper": "^1.4",
|
||||||
"guzzlehttp/guzzle": "^7.2",
|
"guzzlehttp/guzzle": "^7.2",
|
||||||
|
|||||||
161
composer.lock
generated
161
composer.lock
generated
@@ -4,8 +4,61 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "7e7ca4b12aa8cb62c957ab3f8746ab67",
|
"content-hash": "531ac89c0e295fb99620a832403db966",
|
||||||
"packages": [
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "alaminfirdows/laravel-editorjs",
|
||||||
|
"version": "v2.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/alaminfirdows/laravel-editorjs.git",
|
||||||
|
"reference": "a2a264370c00e5c4734676b132344c336fa7ccd7"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/alaminfirdows/laravel-editorjs/zipball/a2a264370c00e5c4734676b132344c336fa7ccd7",
|
||||||
|
"reference": "a2a264370c00e5c4734676b132344c336fa7ccd7",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"codex-team/editor.js": "v2.0.7",
|
||||||
|
"illuminate/support": "^8.0|^9.0|^10.0",
|
||||||
|
"php": "^7.2|^8.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"orchestra/testbench": "^6.0",
|
||||||
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"laravel": {
|
||||||
|
"providers": [
|
||||||
|
"AlAminFirdows\\LaravelEditorJs\\LaravelEditorJsServiceProvider"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"AlAminFirdows\\LaravelEditorJs\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Al-Amin Firdows",
|
||||||
|
"email": "alaminfirdows@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A simple editor.js html parser for Laravel",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/alaminfirdows/laravel-editorjs/issues",
|
||||||
|
"source": "https://github.com/alaminfirdows/laravel-editorjs/tree/v2.1.0"
|
||||||
|
},
|
||||||
|
"time": "2023-02-26T11:15:40+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "artesaos/seotools",
|
"name": "artesaos/seotools",
|
||||||
"version": "v1.2.0",
|
"version": "v1.2.0",
|
||||||
@@ -133,6 +186,51 @@
|
|||||||
],
|
],
|
||||||
"time": "2023-01-15T23:15:59+00:00"
|
"time": "2023-01-15T23:15:59+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "codex-team/editor.js",
|
||||||
|
"version": "v2.0.7",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/editor-js/editorjs-php.git",
|
||||||
|
"reference": "b2c6586c948ed30683718184f0156b0b1fd9593f"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/editor-js/editorjs-php/zipball/b2c6586c948ed30683718184f0156b0b1fd9593f",
|
||||||
|
"reference": "b2c6586c948ed30683718184f0156b0b1fd9593f",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ezyang/htmlpurifier": "^4.8",
|
||||||
|
"php": ">=5.6"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^2.13",
|
||||||
|
"phpunit/phpunit": "5.4.*"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"EditorJS\\": "EditorJS"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "CodeX Team",
|
||||||
|
"email": "team@ifmo.su"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "PHP backend implementation for the Editor.js",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/editor-js/editorjs-php/issues",
|
||||||
|
"source": "https://github.com/editor-js/editorjs-php/tree/v2.0.7"
|
||||||
|
},
|
||||||
|
"time": "2020-06-12T09:55:49+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/ca-bundle",
|
"name": "composer/ca-bundle",
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
@@ -580,6 +678,67 @@
|
|||||||
],
|
],
|
||||||
"time": "2023-01-14T14:17:03+00:00"
|
"time": "2023-01-14T14:17:03+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "ezyang/htmlpurifier",
|
||||||
|
"version": "v4.16.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/ezyang/htmlpurifier.git",
|
||||||
|
"reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8",
|
||||||
|
"reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"cerdic/css-tidy": "^1.7 || ^2.0",
|
||||||
|
"simpletest/simpletest": "dev-master"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.",
|
||||||
|
"ext-bcmath": "Used for unit conversion and imagecrash protection",
|
||||||
|
"ext-iconv": "Converts text to and from non-UTF-8 encodings",
|
||||||
|
"ext-tidy": "Used for pretty-printing HTML"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"library/HTMLPurifier.composer.php"
|
||||||
|
],
|
||||||
|
"psr-0": {
|
||||||
|
"HTMLPurifier": "library/"
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/library/HTMLPurifier/Language/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"LGPL-2.1-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Edward Z. Yang",
|
||||||
|
"email": "admin@htmlpurifier.org",
|
||||||
|
"homepage": "http://ezyang.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Standards compliant HTML filter written in PHP",
|
||||||
|
"homepage": "http://htmlpurifier.org/",
|
||||||
|
"keywords": [
|
||||||
|
"html"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/ezyang/htmlpurifier/issues",
|
||||||
|
"source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0"
|
||||||
|
},
|
||||||
|
"time": "2022-09-18T07:06:19+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "fruitcake/php-cors",
|
"name": "fruitcake/php-cors",
|
||||||
"version": "v1.2.0",
|
"version": "v1.2.0",
|
||||||
|
|||||||
@@ -162,7 +162,6 @@
|
|||||||
Barryvdh\Debugbar\ServiceProvider::class,
|
Barryvdh\Debugbar\ServiceProvider::class,
|
||||||
Stevebauman\Location\LocationServiceProvider::class,
|
Stevebauman\Location\LocationServiceProvider::class,
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Application Service Providers...
|
* Application Service Providers...
|
||||||
*/
|
*/
|
||||||
@@ -171,7 +170,7 @@
|
|||||||
// App\Providers\BroadcastServiceProvider::class,
|
// App\Providers\BroadcastServiceProvider::class,
|
||||||
App\Providers\EventServiceProvider::class,
|
App\Providers\EventServiceProvider::class,
|
||||||
App\Providers\RouteServiceProvider::class,
|
App\Providers\RouteServiceProvider::class,
|
||||||
App\Providers\ViewServiceProvider::class,
|
App\Providers\ViewServiceProvider::class,
|
||||||
])->toArray(),
|
])->toArray(),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
146
config/laravel_editorjs.php
Normal file
146
config/laravel_editorjs.php
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'config' => [
|
||||||
|
'tools' => [
|
||||||
|
'paragraph' => [
|
||||||
|
'text' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'header' => [
|
||||||
|
'text' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'a[href],mark[class]',
|
||||||
|
],
|
||||||
|
'level' => [1, 2, 3, 4, 5, 6],
|
||||||
|
],
|
||||||
|
'list' => [
|
||||||
|
'type' => [
|
||||||
|
0 => 'ordered',
|
||||||
|
1 => 'unordered',
|
||||||
|
],
|
||||||
|
'items' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'data' => [
|
||||||
|
'-' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'linkTool' => [
|
||||||
|
'link' => 'string',
|
||||||
|
'meta' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'data' => [
|
||||||
|
'title' => [
|
||||||
|
'type' => 'string',
|
||||||
|
],
|
||||||
|
'description' => [
|
||||||
|
'type' => 'string',
|
||||||
|
],
|
||||||
|
'url' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'required' => false,
|
||||||
|
],
|
||||||
|
'domain' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'required' => false,
|
||||||
|
],
|
||||||
|
'image' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'required' => false,
|
||||||
|
'data' => [
|
||||||
|
'url' => [
|
||||||
|
'type' => 'string',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'image' => [
|
||||||
|
'file' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'data' => [
|
||||||
|
'width' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'required' => false,
|
||||||
|
],
|
||||||
|
'height' => [
|
||||||
|
'type' => 'integer',
|
||||||
|
'required' => false,
|
||||||
|
],
|
||||||
|
'url' => 'string',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'caption' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
'withBorder' => 'boolean',
|
||||||
|
'withBackground' => 'boolean',
|
||||||
|
'stretched' => 'boolean',
|
||||||
|
],
|
||||||
|
'table' => [
|
||||||
|
'withHeadings' => 'boolean',
|
||||||
|
'content' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'data' => [
|
||||||
|
'-' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'data' => [
|
||||||
|
'-' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'quote' => [
|
||||||
|
'text' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
'caption' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => 'i,b,a[href],code[class],mark[class]',
|
||||||
|
],
|
||||||
|
'alignment' => [
|
||||||
|
0 => 'left',
|
||||||
|
1 => 'center',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'code' => [
|
||||||
|
'code' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => '*',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
'delimiter' => [],
|
||||||
|
'raw' => [
|
||||||
|
'html' => [
|
||||||
|
'type' => 'string',
|
||||||
|
'allowedTags' => '*',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
// 'attaches' => [
|
||||||
|
// 'file' => [
|
||||||
|
// 'type' => 'array',
|
||||||
|
// 'data' => [
|
||||||
|
// 'url' => 'string',
|
||||||
|
// 'size' => 'integer',
|
||||||
|
// 'name' => 'string',
|
||||||
|
// 'extension' => 'string',
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
// 'title' => 'string',
|
||||||
|
// ]
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -12,8 +12,8 @@
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('categories', function (Blueprint $table) {
|
Schema::table('categories', function (Blueprint $table) {
|
||||||
$table->string('country_locale_slug')->after('country_locale_id')->default('my');
|
$table->string('country_locale_slug')->after('country_locale_id')->default('my');
|
||||||
$table->foreign('country_locale_slug')->references('slug')->on('country_locales');
|
$table->foreign('country_locale_slug')->references('slug')->on('country_locales');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ public function up(): void
|
|||||||
$table->string('featured_image');
|
$table->string('featured_image');
|
||||||
$table->enum('editor', ['editorjs'])->default('editorjs');
|
$table->enum('editor', ['editorjs'])->default('editorjs');
|
||||||
$table->json('body')->nullable();
|
$table->json('body')->nullable();
|
||||||
$table->enum('post_format',['standard'])->default('standard');
|
$table->enum('post_format', ['standard'])->default('standard');
|
||||||
$table->integer('comment_count')->default(0);
|
$table->integer('comment_count')->default(0);
|
||||||
$table->integer('likes_count')->default(0);
|
$table->integer('likes_count')->default(0);
|
||||||
$table->enum('status', ['publish','future','draft','private','trash'])->default('draft');
|
$table->enum('status', ['publish', 'future', 'draft', 'private', 'trash'])->default('draft');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
|
|
||||||
$table->foreign('author_id')->references('id')->on('authors');
|
$table->foreign('author_id')->references('id')->on('authors');
|
||||||
|
|||||||
@@ -2,20 +2,14 @@
|
|||||||
|
|
||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
use App\Models\Author;
|
use App\Models\Author;
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
use App\Models\Post;
|
use App\Models\Post;
|
||||||
use App\Models\PostCategory;
|
use App\Models\PostCategory;
|
||||||
|
|
||||||
use Faker\Factory as FakerFactory;
|
use Faker\Factory as FakerFactory;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
|
||||||
class PostsSeeder extends Seeder
|
class PostsSeeder extends Seeder
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -23,48 +17,45 @@ class PostsSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
$authors = Author::where('enabled', true)->get();
|
$authors = Author::where('enabled', true)->get();
|
||||||
|
|
||||||
$categories = Category::Where('enabled', true)->get();
|
$categories = Category::where('enabled', true)->get();
|
||||||
|
|
||||||
|
$faker = FakerFactory::create();
|
||||||
|
|
||||||
$faker = FakerFactory::create();
|
for ($i = 0; $i < 20; $i++) {
|
||||||
|
|
||||||
|
$photo_id = (($i + 1) % 16); // placekitten has only 16 photos
|
||||||
|
|
||||||
for ($i = 0; $i < 20; $i++) {
|
$post_title = $faker->sentence;
|
||||||
|
$post_slug = Str::slug($post_title, '-');
|
||||||
|
|
||||||
$photo_id = (($i + 1) % 16); // placekitten has only 16 photos
|
$cloned_authors = clone $authors;
|
||||||
|
$cloned_categories = clone $categories;
|
||||||
|
|
||||||
$post_title = $faker->sentence;
|
$createdAt = $faker->dateTimeBetween('-1 year', 'now');
|
||||||
$post_slug = Str::slug($post_title, "-");
|
|
||||||
|
|
||||||
$cloned_authors = clone $authors;
|
$post = Post::create([
|
||||||
$cloned_categories = clone $categories;
|
'title' => $post_title,
|
||||||
|
'slug' => $post_slug,
|
||||||
|
'excerpt' => $faker->paragraph,
|
||||||
|
'author_id' => $cloned_authors->shuffle()->first()->id,
|
||||||
|
'featured' => rand(0, 1),
|
||||||
|
'featured_image' => "https://placekitten.com/1920/1080?image={$photo_id}",
|
||||||
|
'editor' => 'editorjs',
|
||||||
|
'post_format' => 'standard',
|
||||||
|
'comment_count' => rand(0, 100),
|
||||||
|
'likes_count' => rand(0, 100),
|
||||||
|
'status' => 'publish',
|
||||||
|
'body' => "{\"time\":1563816717958,\"blocks\":[{\"data\":{\"text\":\"Editor.js\",\"level\":2},\"type\":\"header\"},{\"data\":{\"text\":\"Hey. Meet the new Editor. On this page you can see it in action \\u2014 try to edit this text.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Key features\",\"level\":3},\"type\":\"header\"},{\"data\":{\"items\":[\"It is a block-styled editor\",\"It returns clean data output in JSON\",\"Designed to be extendable and pluggable with a simple API\"],\"style\":\"unordered\"},\"type\":\"list\"},{\"data\":{\"text\":\"What does it mean \\u00abblock-styled editor\\u00bb\",\"level\":3},\"type\":\"header\"},{\"data\":{\"text\":\"Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js <mark class=\\\"cdx-marker\\\">workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc<\\\/mark>. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor's Core.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"There are dozens of <a href=\\\"https:\\\/\\\/github.com\\\/editor-js\\\">ready-to-use Blocks<\\\/a> and the <a href=\\\"https:\\\/\\\/editorjs.io\\\/creating-a-block-tool\\\">simple API<\\\/a> for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"What does it mean clean data output\",\"level\":3},\"type\":\"header\"},{\"data\":{\"text\":\"Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Given data can be used as you want: render with HTML for <code class=\\\"inline-code\\\">Web clients<\\\/code>, render natively for <code class=\\\"inline-code\\\">mobile apps<\\\/code>, create markup for <code class=\\\"inline-code\\\">Facebook Instant Articles<\\\/code> or <code class=\\\"inline-code\\\">Google AMP<\\\/code>, generate an <code class=\\\"inline-code\\\">audio version<\\\/code> and so on.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Clean data is useful to sanitize, validate and process on the backend.\"},\"type\":\"paragraph\"},{\"data\":[],\"type\":\"delimiter\"},{\"data\":{\"text\":\"We have been working on this project more than three years. Several large media projects help us to test and debug the Editor, to make it's core more stable. At the same time we significantly improved the API. Now, it can be used to create any plugin for any task. Hope you enjoy. \\ud83d\\ude0f\"},\"type\":\"paragraph\"},{\"data\":{\"file\":{\"url\":\"https:\\\/\\\/codex.so\\\/upload\\\/redactor_images\\\/o_e48549d1855c7fc1807308dd14990126.jpg\"},\"caption\":\"Image caption\",\"stretched\":false,\"withBorder\":true,\"withBackground\":false},\"type\":\"image\"}],\"version\":\"2.15.0\"}",
|
||||||
|
'created_at' => $createdAt,
|
||||||
|
'updated_at' => $createdAt,
|
||||||
|
]);
|
||||||
|
|
||||||
$createdAt = $faker->dateTimeBetween('-1 year', 'now');
|
$post_category = PostCategory::create([
|
||||||
|
'post_id' => $post->id,
|
||||||
|
'category_id' => $cloned_categories->shuffle()->first()->id,
|
||||||
$post = Post::create([
|
]);
|
||||||
"title" => $post_title,
|
}
|
||||||
"slug" => $post_slug,
|
|
||||||
"excerpt" => $faker->paragraph,
|
|
||||||
"author_id" => $cloned_authors->random()->first()->id,
|
|
||||||
"featured" => rand(0,1),
|
|
||||||
"featured_image" => "https://placekitten.com/1920/1080?image={$photo_id}",
|
|
||||||
"editor" => "editorjs",
|
|
||||||
"post_format" => "standard",
|
|
||||||
"comment_count" => rand(0,100),
|
|
||||||
"likes_count" => rand(0,100),
|
|
||||||
"status" => "publish",
|
|
||||||
"body" => "{\"time\":1563816717958,\"blocks\":[{\"data\":{\"text\":\"Editor.js\",\"level\":2},\"type\":\"header\"},{\"data\":{\"text\":\"Hey. Meet the new Editor. On this page you can see it in action \\u2014 try to edit this text.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Key features\",\"level\":3},\"type\":\"header\"},{\"data\":{\"items\":[\"It is a block-styled editor\",\"It returns clean data output in JSON\",\"Designed to be extendable and pluggable with a simple API\"],\"style\":\"unordered\"},\"type\":\"list\"},{\"data\":{\"text\":\"What does it mean \\u00abblock-styled editor\\u00bb\",\"level\":3},\"type\":\"header\"},{\"data\":{\"text\":\"Workspace in classic editors is made of a single contenteditable element, used to create different HTML markups. Editor.js <mark class=\\\"cdx-marker\\\">workspace consists of separate Blocks: paragraphs, headings, images, lists, quotes, etc<\\\/mark>. Each of them is an independent contenteditable element (or more complex structure) provided by Plugin and united by Editor's Core.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"There are dozens of <a href=\\\"https:\\\/\\\/github.com\\\/editor-js\\\">ready-to-use Blocks<\\\/a> and the <a href=\\\"https:\\\/\\\/editorjs.io\\\/creating-a-block-tool\\\">simple API<\\\/a> for creation any Block you need. For example, you can implement Blocks for Tweets, Instagram posts, surveys and polls, CTA-buttons and even games.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"What does it mean clean data output\",\"level\":3},\"type\":\"header\"},{\"data\":{\"text\":\"Classic WYSIWYG-editors produce raw HTML-markup with both content data and content appearance. On the contrary, Editor.js outputs JSON object with data of each Block. You can see an example below\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Given data can be used as you want: render with HTML for <code class=\\\"inline-code\\\">Web clients<\\\/code>, render natively for <code class=\\\"inline-code\\\">mobile apps<\\\/code>, create markup for <code class=\\\"inline-code\\\">Facebook Instant Articles<\\\/code> or <code class=\\\"inline-code\\\">Google AMP<\\\/code>, generate an <code class=\\\"inline-code\\\">audio version<\\\/code> and so on.\"},\"type\":\"paragraph\"},{\"data\":{\"text\":\"Clean data is useful to sanitize, validate and process on the backend.\"},\"type\":\"paragraph\"},{\"data\":[],\"type\":\"delimiter\"},{\"data\":{\"text\":\"We have been working on this project more than three years. Several large media projects help us to test and debug the Editor, to make it's core more stable. At the same time we significantly improved the API. Now, it can be used to create any plugin for any task. Hope you enjoy. \\ud83d\\ude0f\"},\"type\":\"paragraph\"},{\"data\":{\"file\":{\"url\":\"https:\\\/\\\/codex.so\\\/upload\\\/redactor_images\\\/o_e48549d1855c7fc1807308dd14990126.jpg\"},\"caption\":\"Image caption\",\"stretched\":false,\"withBorder\":true,\"withBackground\":false},\"type\":\"image\"}],\"version\":\"2.15.0\"}",
|
|
||||||
'created_at' => $createdAt,
|
|
||||||
'updated_at' => $createdAt,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$post_category = PostCategory::create([
|
|
||||||
'post_id' => $post->id,
|
|
||||||
'category_id' => $cloned_categories->random()->first()->id,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
BIN
resources/.DS_Store
vendored
BIN
resources/.DS_Store
vendored
Binary file not shown.
BIN
resources/views/.DS_Store
vendored
BIN
resources/views/.DS_Store
vendored
Binary file not shown.
21
resources/views/admin/posts.blade.php
Normal file
21
resources/views/admin/posts.blade.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
@extends('layouts.admin.app')
|
||||||
|
|
||||||
|
@section('custom_styles')
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="page-body">
|
||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
|
<div class="alert alert-success">
|
||||||
|
<div class="alert-title">
|
||||||
|
{{ __('Welcome') }} {{ auth()->user()->name ?? null }}
|
||||||
|
</div>
|
||||||
|
<div class="text-muted">
|
||||||
|
{{ __('You are logged in!') }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
68
resources/views/admin/posts/manage.blade.php
Normal file
68
resources/views/admin/posts/manage.blade.php
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
@extends('layouts.admin.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="container-xl">
|
||||||
|
<!-- Page title -->
|
||||||
|
<div class="page-header d-print-none">
|
||||||
|
<h2 class="page-title">
|
||||||
|
{{ __('Posts') }}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="page-body">
|
||||||
|
<div class="container-xl">
|
||||||
|
|
||||||
|
<div class="alert alert-info">
|
||||||
|
<div class="alert-title">Manage your blog posts here.</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex mb-3">
|
||||||
|
<div><a href="{{ route('posts.manage.new') }}" class="btn">New Post</a></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table" id="dataTable" width="100%" cellspacing="0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{ __('Post #') }}</th>
|
||||||
|
<th>
|
||||||
|
Image
|
||||||
|
</th>
|
||||||
|
<th>Title</th>
|
||||||
|
<th>{{ __('Created at') }}</th>
|
||||||
|
<th>{{ __('Updated in') }}</th>
|
||||||
|
<th>Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($posts as $post)
|
||||||
|
<tr>
|
||||||
|
<td>{{ $post->id }}</td>
|
||||||
|
<td><img width="80" height="60" src="{{ $post->featured_image }}"
|
||||||
|
class="img-fluid rounded-2" alt=""></td>
|
||||||
|
<td>
|
||||||
|
<a
|
||||||
|
href="{{ route('home.country.post', ['country' => $post->post_category->category->country_locale_slug, 'post_slug' => $post->slug]) }}">{{ $post->title }}</a>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>{{ $post->created_at }}</td>
|
||||||
|
<td>{{ $post->updated_at->diffForhumans() }}</td>
|
||||||
|
<td>
|
||||||
|
<div><a href="{{ route('posts.manage.edit', ['post_id' => $post->id]) }}"
|
||||||
|
class="btn">Edit</a></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
@if ($posts->hasPages())
|
||||||
|
<div class="card-footer pb-0">
|
||||||
|
{{ $posts->links() }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -5,7 +5,9 @@
|
|||||||
<div class="row justify-content-center text-center">
|
<div class="row justify-content-center text-center">
|
||||||
<div class="col-12 col-lg-8 py-5">
|
<div class="col-12 col-lg-8 py-5">
|
||||||
<h2 class="h3 fw-bold">ProductAlert is the place to be for top rated product reviews with recommendation such
|
<h2 class="h3 fw-bold">ProductAlert is the place to be for top rated product reviews with recommendation such
|
||||||
as the right price, latest trend, from the best brands from {{ ($country_locale->country_iso == '*') ? 'the whole world' :get_country_name_by_iso($country_locale->country_iso) }}.</h2>
|
as the right price, latest trend, from the best brands from
|
||||||
|
{{ $country_locale->country_iso == '*' ? 'the whole world' : get_country_name_by_iso($country_locale->country_iso) }}.
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -13,23 +15,47 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<h3 class="h4 fw-bold text-center mb-3">Featured Articles</h3>
|
<h3 class="h4 fw-bold text-center mb-3">Featured Articles</h3>
|
||||||
<div class="row g-3 justify-content-center">
|
<div class="row g-3 justify-content-center">
|
||||||
@foreach($featured_posts as $post)
|
@foreach ($featured_posts as $post)
|
||||||
<div class="col-12 col-xl-3">
|
<div class="col-12 col-xl-3">
|
||||||
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => $post->slug]) }}" class="text-decoration-none">
|
|
||||||
<div class="card shadow-sm" style="height:100%;">
|
<div class="card shadow-sm" style="height:100%;">
|
||||||
|
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}"
|
||||||
|
class="text-decoration-none">
|
||||||
<div class="card-img-top ratio ratio-16x9">
|
<div class="card-img-top ratio ratio-16x9">
|
||||||
<img src="{{ $post->featured_image }}" alt="">
|
<img src="{{ $post->featured_image }}" alt="Photo of {{ $post->title }}">
|
||||||
</div>
|
</div>
|
||||||
|
</a>
|
||||||
<div class="card-body">
|
|
||||||
<p class="card-text fw-bold">{{ $post->title }}</p>
|
<div class="card-body d-flex justify-content-between flex-column">
|
||||||
|
|
||||||
|
<div class="mb-2">
|
||||||
|
|
||||||
|
<p class="card-text fw-bold">
|
||||||
|
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}"
|
||||||
|
class="text-decoration-none">{{ $post->title }}</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p class="card-text mb-0">
|
||||||
|
<small>in </small>
|
||||||
|
@foreach ($post->post_categories as $post_category)
|
||||||
|
<small><a class="text-decoration-none"
|
||||||
|
href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => $post_category->category->slug]) }}">{{ $post_category->category->name }}</a>
|
||||||
|
</small>
|
||||||
|
@if (!$loop->last)
|
||||||
|
,
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
{{-- <small class="text-body-secondary ms-2">3 min read</small> --}}
|
||||||
|
</p>
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
<small class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
|
<small class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
|
||||||
{{-- <small class="text-body-secondary">9 min read</small> --}}
|
{{-- <small class="text-body-secondary">9 min read</small> --}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
@@ -40,35 +66,59 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col col-md-12 col-lg-12 col-xl-11 col-xxl-9">
|
<div class="col col-md-12 col-lg-12 col-xl-11 col-xxl-9">
|
||||||
<h3 class="h4 fw-bold text-center mb-3">What's New in {{ get_country_name_by_iso($country_locale->country_iso) }}</h3>
|
<h3 class="h4 fw-bold text-center mb-3">What's New in
|
||||||
|
{{ get_country_name_by_iso($country_locale->country_iso) }}</h3>
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
@foreach ($latest_posts as $post)
|
@foreach ($latest_posts as $post)
|
||||||
<div class="col-lg-6">
|
<div class="col-lg-6">
|
||||||
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}" class="text-decoration-none">
|
|
||||||
<div class="card" style="height:100%;">
|
<div class="card" style="height:100%;">
|
||||||
<div class="row g-0">
|
<div class="row g-0">
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
|
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => str_random()]) }}"
|
||||||
|
class="text-decoration-none">
|
||||||
<div class="img-fluid rounded-start ratio ratio-16x9">
|
<div class="img-fluid rounded-start ratio ratio-16x9">
|
||||||
<img src="{{ $post->featured_image }}" alt="">
|
<img src="{{ $post->featured_image }}"
|
||||||
|
alt="Photo of {{ $post->title }}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</a>
|
||||||
<div class="col-md-7">
|
</div>
|
||||||
<div class="card-body">
|
<div class="col-md-7">
|
||||||
<p class="card-title fw-bold">H{{ $post->title }}</p>
|
<div class="card-body d-flex justify-content-between flex-column"
|
||||||
<div class="d-flex justify-content-between align-items-center">
|
style="height:100%;">
|
||||||
<small class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
|
<div>
|
||||||
</div>
|
<a href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => str_random()]) }}"
|
||||||
|
class="text-decoration-none">
|
||||||
|
<p class="card-title fw-bold">{{ $post->title }}</p>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-between align-items-center">
|
||||||
|
<p class="card-text mb-0">
|
||||||
|
<small>in </small>
|
||||||
|
@foreach ($post->post_categories as $post_category)
|
||||||
|
<small><a class="text-decoration-none"
|
||||||
|
href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => $post_category->category->slug]) }}">{{ $post_category->category->name }}</a>
|
||||||
|
</small>
|
||||||
|
@if (!$loop->last)
|
||||||
|
,
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
{{-- <small class="text-body-secondary ms-2">3 min read</small> --}}
|
||||||
|
</p>
|
||||||
|
<small
|
||||||
|
class="text-body-secondary">{{ $post->created_at->format('j F Y') }}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center py-3">
|
<div class="text-center py-3">
|
||||||
<a href="{{ route('home.country.posts', ['country' => $country_locale->country_iso ]) }}" class="btn btn-primary">All News & Updates</a>
|
<a href="{{ route('home.country.posts', ['country' => $country_locale->country_iso]) }}"
|
||||||
|
class="btn btn-primary">All News & Updates</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,66 +5,62 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-12 col-lg-11 col-xl-9 col-xxl-8">
|
<div class="col-12 col-lg-11 col-xl-9 col-xxl-8">
|
||||||
|
|
||||||
|
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-8 col-lg-8 col-xl-8">
|
<div class="col-md-8 col-lg-8 col-xl-8">
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<h1 class="h2 fw-bold">All {{ $country_locale->name }} News</h1>
|
<h1 class="h2 fw-bold">All {{ $country_locale->name }} News</h1>
|
||||||
<p class="text-secondary">
|
<p class="text-secondary">
|
||||||
The latest {{ $country_locale->name }} news, brought to you by {{ config('app.name') }}
|
The latest {{ $country_locale->name }} news, brought to you by {{ config('app.name') }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@for($i = 0; $i < 10; $i++)
|
@foreach ($latest_posts as $post)
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card mb-3">
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
<div class="card mb-3">
|
<h5 class="card-title">
|
||||||
|
<a class="text-decoration-none fw-bold"
|
||||||
<div class="card-body">
|
href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}">{{ $post->title }}</a>
|
||||||
<h5 class="card-title">
|
</h5>
|
||||||
<a class="text-decoration-none" href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}">Here is why a kitten catches mice faster than an adult cat.</a></h5>
|
|
||||||
<p class="card-text">
|
|
||||||
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small><a class="text-decoration-none" href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => 'technology' ]) }}">#technology</a> <a class="text-decoration-none" href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => 'gadgets' ]) }}">#gadgets</a></small>
|
in
|
||||||
<small class="text-body-secondary ms-2">3 min read</small>
|
@foreach ($post->post_categories as $post_category)
|
||||||
</p>
|
<small><a class="text-decoration-none"
|
||||||
|
href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => $post_category->category->slug]) }}">{{ $post_category->category->name }}</a>
|
||||||
|
</small>
|
||||||
|
@endforeach
|
||||||
|
{{-- <small class="text-body-secondary ms-2">3 min read</small> --}}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a class="card-img-top"
|
||||||
|
href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}">
|
||||||
|
<img src="{{ $post->featured_image }}"
|
||||||
|
class="card-img-top rounded-bottom-2 rounded-top-0"
|
||||||
|
alt="Photo of {{ $post->title }}">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
{{ $latest_posts->links() }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<a class="card-img-top" href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}">
|
</div>
|
||||||
<img src="https://placekitten.com/400/300" class="card-img-top rounded-bottom-2 rounded-top-0" alt="...">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@endfor
|
|
||||||
|
|
||||||
<nav aria-label="Page navigation example">
|
|
||||||
<ul class="pagination">
|
|
||||||
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">Next</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
@endsection
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@endsection
|
|
||||||
|
|||||||
@@ -4,68 +4,65 @@
|
|||||||
<div class="container py-3">
|
<div class="container py-3">
|
||||||
|
|
||||||
|
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-12 col-lg-11 col-xl-9 col-xxl-8">
|
<div class="col-12 col-lg-11 col-xl-9 col-xxl-8">
|
||||||
|
|
||||||
|
|
||||||
<div class="row justify-content-center">
|
<div class="row justify-content-center">
|
||||||
<div class="col-md-8 col-lg-8 col-xl-8">
|
<div class="col-md-8 col-lg-8 col-xl-8">
|
||||||
|
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<h1 class="h2 fw-bold">{{ $category->name }}</h1>
|
<h1 class="h2 fw-bold">{{ $category->name }}</h1>
|
||||||
<p class="text-secondary">
|
<p class="text-secondary">
|
||||||
{{ $category->description }}
|
{{ $category->description }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@for($i = 0; $i < 10; $i++)
|
@foreach ($latest_posts as $post)
|
||||||
<div class="my-3">
|
<div class="my-3">
|
||||||
|
|
||||||
|
|
||||||
<div class="card mb-3">
|
|
||||||
|
|
||||||
<div class="card-body">
|
|
||||||
<h5 class="card-title">
|
|
||||||
<a class="text-decoration-none" href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}">Here is why a kitten catches mice faster than an adult cat.</a></h5>
|
|
||||||
<p class="card-text">
|
|
||||||
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p class="card-text">
|
<div class="card mb-3">
|
||||||
<small><a class="text-decoration-none" href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => 'technology' ]) }}">#technology</a> <a class="text-decoration-none" href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => 'gadgets' ]) }}">#gadgets</a></small>
|
|
||||||
<small class="text-body-secondary ms-2">3 min read</small>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">
|
||||||
|
<a class="text-decoration-none fw-bold"
|
||||||
|
href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}">{{ $post->title }}</a>
|
||||||
|
</h5>
|
||||||
|
|
||||||
|
<p class="card-text">
|
||||||
|
in
|
||||||
|
@foreach ($post->post_categories as $post_category)
|
||||||
|
<small><a class="text-decoration-none"
|
||||||
|
href="{{ route('home.country.category', ['country' => $country_locale->country_iso, 'category' => $post_category->category->slug]) }}">{{ $post_category->category->name }}</a>
|
||||||
|
</small>
|
||||||
|
@endforeach
|
||||||
|
{{-- <small class="text-body-secondary ms-2">3 min read</small> --}}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<a class="card-img-top"
|
||||||
|
href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post_slug' => $post->slug]) }}">
|
||||||
|
<img src="{{ $post->featured_image }}"
|
||||||
|
class="card-img-top rounded-bottom-2 rounded-top-0"
|
||||||
|
alt="Photo of {{ $post->title }}">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
{{ $latest_posts->links() }}
|
||||||
</div>
|
</div>
|
||||||
<a class="card-img-top" href="{{ route('home.country.post', ['country' => $country_locale->country_iso, 'post' => str_random() ]) }}">
|
{{-- <div class="col-md-4 col-lg-4 col-xl-4 bg-secondary">
|
||||||
<img src="https://placekitten.com/400/300" class="card-img-top rounded-bottom-2 rounded-top-0" alt="...">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@endfor
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<nav class="col" aria-label="Page navigation example">
|
|
||||||
<ul class="pagination">
|
|
||||||
<li class="page-item"><a class="page-link" href="#">Previous</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">1</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
|
||||||
<li class="page-item"><a class="page-link" href="#">Next</a></li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{-- <div class="col-md-4 col-lg-4 col-xl-4 bg-secondary">
|
|
||||||
b
|
b
|
||||||
</div> --}}
|
</div> --}}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -2,6 +2,43 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container py-3">
|
<div class="container py-3">
|
||||||
Post
|
<div class="row justify-content-center">
|
||||||
</div>
|
<div class="col-12 col-lg-11 col-xl-9 col-xxl-8">
|
||||||
@endsection
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-8 col-lg-8 col-xl-8 text-left">
|
||||||
|
<div class="mb-2">
|
||||||
|
<h1 class="h3 fw-bold mb-1">{{ $post->title }}</h1>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span>
|
||||||
|
in
|
||||||
|
@foreach ($post->post_categories as $post_category)
|
||||||
|
<small><a class="text-decoration-none"
|
||||||
|
href="{{ route('home.country.category', ['country' => $post_category->category->country_locale_slug, 'category' => $post_category->category->slug]) }}">{{ $post_category->category->name }}</a>
|
||||||
|
</small>
|
||||||
|
@endforeach
|
||||||
|
</span>
|
||||||
|
<span class="ms-2">
|
||||||
|
<small>
|
||||||
|
|
||||||
|
Written by {{ $post->author->name }}
|
||||||
|
</small>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<h2 class="h5">{{ $post->excerpt }}</h2>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<img src="{{ $post->featured_image }}" alt="" class="img-fluid rounded-3">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
{{ $post->html_body }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||||
|
|
||||||
@vite('resources/sass/app.scss')
|
@vite('resources/sass/admin-app.scss')
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="border-top-wide border-primary d-flex flex-column">
|
<body class="border-top-wide border-primary d-flex flex-column">
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@vite('resources/js/app.js')
|
@vite('resources/js/admin-app.js')
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from ht
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item @if (request()->routeIs('dashboard')) active @endif">
|
{{-- <li class="nav-item @if (request()->routeIs('dashboard')) active @endif">
|
||||||
<a class="nav-link" href="{{ route('dashboard') }}">
|
<a class="nav-link" href="{{ route('dashboard') }}">
|
||||||
<span
|
<span
|
||||||
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
||||||
@@ -43,7 +43,29 @@ class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from ht
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
--}}
|
||||||
|
<li class="nav-item @if (request()->routeIs('posts.manage')) active @endif">
|
||||||
|
<a class="nav-link" href="{{ route('posts.manage') }}">
|
||||||
|
<span
|
||||||
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-list"
|
||||||
|
width="24" height="24" viewBox="0 0 24 24" stroke-width="2"
|
||||||
|
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M9 6l11 0"></path>
|
||||||
|
<path d="M9 12l11 0"></path>
|
||||||
|
<path d="M9 18l11 0"></path>
|
||||||
|
<path d="M5 6l0 .01"></path>
|
||||||
|
<path d="M5 12l0 .01"></path>
|
||||||
|
<path d="M5 18l0 .01"></path>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
|
<span class="nav-link-title">
|
||||||
|
{{ __('Posts') }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{{--
|
||||||
<li class="nav-item @if (request()->routeIs('users.index')) active @endif">
|
<li class="nav-item @if (request()->routeIs('users.index')) active @endif">
|
||||||
<a class="nav-link" href="{{ route('users.index') }}">
|
<a class="nav-link" href="{{ route('users.index') }}">
|
||||||
<span
|
<span
|
||||||
@@ -62,9 +84,9 @@ class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from ht
|
|||||||
{{ __('Users') }}
|
{{ __('Users') }}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li> --}}
|
||||||
|
|
||||||
<li class="nav-item @if (request()->routeIs('about')) active @endif">
|
{{-- <li class="nav-item @if (request()->routeIs('about')) active @endif">
|
||||||
<a class="nav-link" href="{{ route('about') }}">
|
<a class="nav-link" href="{{ route('about') }}">
|
||||||
<span
|
<span
|
||||||
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/file-text -->
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/file-text -->
|
||||||
@@ -81,9 +103,9 @@ class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from ht
|
|||||||
{{ __('About') }}
|
{{ __('About') }}
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li> --}}
|
||||||
|
|
||||||
<li class="nav-item dropdown">
|
{{-- <li class="nav-item dropdown">
|
||||||
<a class="nav-link dropdown-toggle" href="#navbar-extra" data-bs-toggle="dropdown"
|
<a class="nav-link dropdown-toggle" href="#navbar-extra" data-bs-toggle="dropdown"
|
||||||
data-bs-auto-close="outside" role="button" aria-expanded="false">
|
data-bs-auto-close="outside" role="button" aria-expanded="false">
|
||||||
<span
|
<span
|
||||||
@@ -132,7 +154,7 @@ class="icon icon-tabler icon-tabler-list-details" width="24" height="24"
|
|||||||
Submenu Item #3
|
Submenu Item #3
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li> --}}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,11 +4,12 @@
|
|||||||
<div class="col-6 col-md-2 mb-3">
|
<div class="col-6 col-md-2 mb-3">
|
||||||
<ul class="nav flex-column">
|
<ul class="nav flex-column">
|
||||||
|
|
||||||
@foreach ($categories as $category)
|
@foreach ($categories as $category)
|
||||||
<li class="nav-item mb-2">
|
<li class="nav-item mb-2">
|
||||||
<a class="nav-link p-0 text-body-secondary" href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug ]) }}">{{ $category->name }}</a>
|
<a class="nav-link p-0 text-body-secondary"
|
||||||
</li>
|
href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug]) }}">{{ $category->name }}</a>
|
||||||
@endforeach
|
</li>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -16,13 +17,13 @@
|
|||||||
<div class="col-6 col-md-2 mb-3">
|
<div class="col-6 col-md-2 mb-3">
|
||||||
<ul class="nav flex-column">
|
<ul class="nav flex-column">
|
||||||
<li class="nav-item mb-2">
|
<li class="nav-item mb-2">
|
||||||
<a href="#" class="nav-link p-0 text-body-secondary">About Us</a>
|
<a href="#" class="nav-link p-0 text-body-secondary">About Us</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item mb-2">
|
<li class="nav-item mb-2">
|
||||||
<a href="#" class="nav-link p-0 text-body-secondary">Contact Us</a>
|
<a href="#" class="nav-link p-0 text-body-secondary">Contact Us</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item mb-2">
|
<li class="nav-item mb-2">
|
||||||
<a href="#" class="nav-link p-0 text-body-secondary">Advertise with us</a>
|
<a href="#" class="nav-link p-0 text-body-secondary">Advertise with us</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,22 +32,24 @@
|
|||||||
<div class="col-md-5 offset-md-1 mb-3">
|
<div class="col-md-5 offset-md-1 mb-3">
|
||||||
|
|
||||||
|
|
||||||
@if($country_locales->count() > 1)
|
@if ($country_locales->count() > 1)
|
||||||
<div class="dropdown mb-4">
|
<div class="dropdown mb-4">
|
||||||
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="dropdownMenuSwitch"
|
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="dropdownMenuSwitch"
|
||||||
data-bs-toggle="dropdown" aria-expanded="false">
|
data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
{{ $current_country_locale->name }}
|
{{ $current_country_locale->name }}
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuSwitch">
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenuSwitch">
|
||||||
@foreach ($country_locales as $country_locale)
|
@foreach ($country_locales as $country_locale)
|
||||||
@if ($country_locale->id != $current_country_locale->id)
|
@if ($country_locale->id != $current_country_locale->id)
|
||||||
<li><a class="dropdown-item" href="{{ route('home.country', [
|
<li><a class="dropdown-item"
|
||||||
'country' => $country_locale->slug
|
href="{{ route('home.country', [
|
||||||
]) }}">{{ $country_locale->name }}</a></li>
|
'country' => $country_locale->slug,
|
||||||
@endif
|
]) }}">{{ $country_locale->name }}</a>
|
||||||
@endforeach
|
</li>
|
||||||
</ul>
|
@endif
|
||||||
</div>
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
@@ -63,7 +66,7 @@
|
|||||||
|
|
||||||
<div class="d-flex flex-column flex-sm-row justify-content-center py-4 my-4">
|
<div class="d-flex flex-column flex-sm-row justify-content-center py-4 my-4">
|
||||||
<p>© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.</p>
|
<p>© {{ date('Y') }} {{ config('app.name') }}. All rights reserved.</p>
|
||||||
{{-- <ul class="list-unstyled d-flex">
|
{{-- <ul class="list-unstyled d-flex">
|
||||||
<li class="ms-3"><a class="link-body-emphasis" href="#"><svg class="bi" width="24"
|
<li class="ms-3"><a class="link-body-emphasis" href="#"><svg class="bi" width="24"
|
||||||
height="24">
|
height="24">
|
||||||
<use xlink:href="#twitter"></use>
|
<use xlink:href="#twitter"></use>
|
||||||
|
|||||||
@@ -9,55 +9,61 @@
|
|||||||
aria-labelledby="offcanvasNavbarLabel">
|
aria-labelledby="offcanvasNavbarLabel">
|
||||||
<div class="offcanvas-header">
|
<div class="offcanvas-header">
|
||||||
<h4 class="offcanvas-title fw-bold mb-0" id="offcanvasNavbarLabel">
|
<h4 class="offcanvas-title fw-bold mb-0" id="offcanvasNavbarLabel">
|
||||||
{{ config('app.name') }} {{ str_contains(request()->route()->getName(), 'home.country') ? get_country_emoji_by_iso($current_country_locale->country_iso) : '' }}
|
{{ config('app.name') }}
|
||||||
|
{{ str_contains(request()->route()->getName(),'home.country')? get_country_emoji_by_iso($current_country_locale->country_iso): '' }}
|
||||||
</h4>
|
</h4>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="offcanvas-body p-0">
|
<div class="offcanvas-body p-0">
|
||||||
|
|
||||||
@if($country_locales->count() > 1)
|
@if ($country_locales->count() > 1)
|
||||||
<div class="p-3">
|
<div class="p-3">
|
||||||
<div class="dropdown d-grid">
|
<div class="dropdown d-grid">
|
||||||
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="dropdownMenuSwitch"
|
<button class="btn btn-outline-primary dropdown-toggle" type="button"
|
||||||
data-bs-toggle="dropdown" aria-expanded="false">
|
id="dropdownMenuSwitch" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
{{ $current_country_locale->name }}
|
{{ $current_country_locale->name }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuSwitch">
|
|
||||||
@foreach ($country_locales as $country_locale)
|
|
||||||
@if ($country_locale->id != $current_country_locale->id)
|
|
||||||
<li><a class="dropdown-item" href="{{ route('home.country', [
|
|
||||||
'country' => $country_locale->slug
|
|
||||||
]) }}">{{ $country_locale->name }}</a></li>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
<ul class="dropdown-menu" aria-labelledby="dropdownMenuSwitch">
|
||||||
</div>
|
@foreach ($country_locales as $country_locale)
|
||||||
|
@if ($country_locale->id != $current_country_locale->id)
|
||||||
|
<li><a class="dropdown-item"
|
||||||
|
href="{{ route('home.country', [
|
||||||
|
'country' => $country_locale->slug,
|
||||||
|
]) }}">{{ $country_locale->name }}</a>
|
||||||
|
</li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
|
||||||
<div class="border-bottom"></div>
|
</div>
|
||||||
@endif
|
</div>
|
||||||
|
|
||||||
<div class="p-3">
|
<div class="border-bottom"></div>
|
||||||
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
|
@endif
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link active" aria-current="page" href="{{ route('home.country', ['country' => $current_country_locale->slug ]) }}">Home</a>
|
<div class="p-3">
|
||||||
</li>
|
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
|
||||||
@foreach ($categories as $category)
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link active" aria-current="page" href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug ]) }}">{{ $category->name }}</a>
|
<a class="nav-link active" aria-current="page"
|
||||||
|
href="{{ route('home.country', ['country' => $current_country_locale->slug]) }}">Home</a>
|
||||||
</li>
|
</li>
|
||||||
@endforeach
|
@foreach ($categories as $category)
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link active" aria-current="page"
|
||||||
|
href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug]) }}">{{ $category->name }}</a>
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="/" class="d-inline-flex link-body-emphasis text-decoration-none">
|
<a href="/" class="d-inline-flex link-body-emphasis text-decoration-none">
|
||||||
<h1 class="h4 mb-0 fw-bold">
|
<h1 class="h4 mb-0 fw-bold">
|
||||||
{{ config('app.name') }} {{ str_contains(request()->route()->getName(), 'home.country') ? get_country_emoji_by_iso($current_country_locale->country_iso) : '' }}
|
{{ config('app.name') }}
|
||||||
|
{{ str_contains(request()->route()->getName(),'home.country')? get_country_emoji_by_iso($current_country_locale->country_iso): '' }}
|
||||||
</h1>
|
</h1>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -65,7 +71,8 @@
|
|||||||
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
|
<ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
|
||||||
@foreach ($categories as $category)
|
@foreach ($categories as $category)
|
||||||
@if ($category->is_top)
|
@if ($category->is_top)
|
||||||
<li><a href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug ]) }}" class="nav-link px-2 link-secondary">{{ $category->short_name }}</a></li>
|
<li><a href="{{ route('home.country.category', ['country' => $category->country_locale_slug, 'category' => $category->slug]) }}"
|
||||||
|
class="nav-link px-2 link-secondary">{{ $category->short_name }}</a></li>
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
3
resources/views/vendor/laravel_editorjs/blocks/code.blade.php
vendored
Normal file
3
resources/views/vendor/laravel_editorjs/blocks/code.blade.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="editor-code">
|
||||||
|
<code class="code__content">{{ htmlspecialchars($data['code']) }}</code>
|
||||||
|
</div>
|
||||||
1
resources/views/vendor/laravel_editorjs/blocks/delimiter.blade.php
vendored
Normal file
1
resources/views/vendor/laravel_editorjs/blocks/delimiter.blade.php
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<div class="editor-delimiter" style="text-align: center;">***</div>
|
||||||
6
resources/views/vendor/laravel_editorjs/blocks/header.blade.php
vendored
Normal file
6
resources/views/vendor/laravel_editorjs/blocks/header.blade.php
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
@php
|
||||||
|
$level = $data['level'] ?? 1;
|
||||||
|
$tag = "h{$level}";
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<{{ $tag }}>{{ $data['text'] ?? '' }}</{{ $tag }}>
|
||||||
21
resources/views/vendor/laravel_editorjs/blocks/image.blade.php
vendored
Normal file
21
resources/views/vendor/laravel_editorjs/blocks/image.blade.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
@php
|
||||||
|
$classes = '';
|
||||||
|
if ($data['stretched']) {
|
||||||
|
$classes .= ' image--stretched';
|
||||||
|
}
|
||||||
|
if ($data['withBorder']) {
|
||||||
|
$classes .= ' image--bordered';
|
||||||
|
}
|
||||||
|
if ($data['withBackground']) {
|
||||||
|
$classes .= ' image--backgrounded';
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<figure class="image {{ $classes }}">
|
||||||
|
<img src="{{ $data['file']['url'] }}" alt="{{ $data['caption'] ?: '' }}">
|
||||||
|
@if (!empty($data['caption']))
|
||||||
|
<footer class="image-caption">
|
||||||
|
{{ $data['caption'] }}
|
||||||
|
</footer>
|
||||||
|
@endif
|
||||||
|
</figure>
|
||||||
18
resources/views/vendor/laravel_editorjs/blocks/link-tool.blade.php
vendored
Normal file
18
resources/views/vendor/laravel_editorjs/blocks/link-tool.blade.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<a class="embed-link" href="{{ $data['link'] }}" target="_blank" rel="nofollow">
|
||||||
|
@php $metaImageUrl = $data['meta']['image']['url'] ?? '' @endphp
|
||||||
|
@if ($metaImageUrl)
|
||||||
|
<img class="embed-link__image" src="{{ $metaImageUrl }}">
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="embed-link__title">
|
||||||
|
{{ $data['meta']['title'] }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="embed-link__description">
|
||||||
|
{{ $data['meta']['description'] }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="embed-link__domain">
|
||||||
|
{{ parse_url($data['link'], PHP_URL_HOST) }}
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
12
resources/views/vendor/laravel_editorjs/blocks/list.blade.php
vendored
Normal file
12
resources/views/vendor/laravel_editorjs/blocks/list.blade.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
@php
|
||||||
|
$tag = 'ul';
|
||||||
|
if ('ordered' === $data['type']) {
|
||||||
|
$tag = 'ol';
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<{{ $tag }}>
|
||||||
|
@foreach ($data['items'] as $item)
|
||||||
|
<li>{{ $item }}</li>
|
||||||
|
@endforeach
|
||||||
|
</{{ $tag }}>
|
||||||
1
resources/views/vendor/laravel_editorjs/blocks/not-found.blade.php
vendored
Normal file
1
resources/views/vendor/laravel_editorjs/blocks/not-found.blade.php
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<p style="color: red">{{ "{$type}: " . __('Block Not Found!') }}</p>
|
||||||
3
resources/views/vendor/laravel_editorjs/blocks/paragraph.blade.php
vendored
Normal file
3
resources/views/vendor/laravel_editorjs/blocks/paragraph.blade.php
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<p>
|
||||||
|
{{ $data['text'] }}
|
||||||
|
</p>
|
||||||
18
resources/views/vendor/laravel_editorjs/blocks/quote.blade.php
vendored
Normal file
18
resources/views/vendor/laravel_editorjs/blocks/quote.blade.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
@php
|
||||||
|
$class = '';
|
||||||
|
|
||||||
|
if ('center' === $data['alignment']) {
|
||||||
|
$class = 'text-center';
|
||||||
|
} elseif ('left' === $data['alignment']) {
|
||||||
|
$class = 'text-left';
|
||||||
|
} else {
|
||||||
|
$class = 'text-right';
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<blockquote class="editor-quote">
|
||||||
|
<p class="{{ $class }}">{{ $data['text'] }}</p>
|
||||||
|
@if (!empty($data['caption']))
|
||||||
|
<small class="{{ $class }}">— {{ $data['caption'] }}</small>
|
||||||
|
@endif
|
||||||
|
</blockquote>
|
||||||
5
resources/views/vendor/laravel_editorjs/blocks/raw.blade.php
vendored
Normal file
5
resources/views/vendor/laravel_editorjs/blocks/raw.blade.php
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<div
|
||||||
|
style="min-height: 200px; background-color: #1e2128; font-family: Menlo, Monaco, Consolas, Courier New, monospace;
|
||||||
|
font-size: 14px; line-height: 1.6; letter-spacing: -0.2px; color: #e2e2e2; padding: 10px 12px;">
|
||||||
|
{{ $data['html'] }}
|
||||||
|
</div>
|
||||||
11
resources/views/vendor/laravel_editorjs/blocks/table.blade.php
vendored
Normal file
11
resources/views/vendor/laravel_editorjs/blocks/table.blade.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<table class="table">
|
||||||
|
@foreach ($data['content'] as $row)
|
||||||
|
<tr>
|
||||||
|
@php $tag = ($loop->first && $data['withHeadings']) ? 'th' : 'td'; @endphp
|
||||||
|
|
||||||
|
@foreach ($row as $cell)
|
||||||
|
<{{ $tag }}> {{ $cell }} </{{ $tag }}>
|
||||||
|
@endforeach
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</table>
|
||||||
@@ -12,22 +12,10 @@
|
|||||||
| be assigned to the "web" middleware group. Make something great!
|
| be assigned to the "web" middleware group. Make something great!
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
Route::get('test', function() {
|
Route::get('test', function () {
|
||||||
return App\Models\Post::first()->body;
|
return App\Models\Post::first()->body;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
Route::get('/', [App\Http\Controllers\Front\HomeController::class, 'index'])->name('home');
|
|
||||||
|
|
||||||
Route::get('/{country}', [App\Http\Controllers\Front\HomeController::class, 'country'])->name('home.country');
|
|
||||||
|
|
||||||
Route::get('/{country}/posts', [App\Http\Controllers\Front\HomeController::class, 'all'])->name('home.country.posts');
|
|
||||||
|
|
||||||
Route::get('/{country}/posts/{post}', [App\Http\Controllers\Front\HomeController::class, 'post'])->name('home.country.post');
|
|
||||||
|
|
||||||
Route::get('/{country}/{category}', [App\Http\Controllers\Front\HomeController::class, 'countryCategory'])->name('home.country.category');
|
|
||||||
|
|
||||||
|
|
||||||
Auth::routes();
|
Auth::routes();
|
||||||
|
|
||||||
Route::prefix('admin')->middleware('auth')->group(function () {
|
Route::prefix('admin')->middleware('auth')->group(function () {
|
||||||
@@ -38,6 +26,22 @@
|
|||||||
|
|
||||||
Route::get('users', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('users.index');
|
Route::get('users', [\App\Http\Controllers\Admin\UserController::class, 'index'])->name('users.index');
|
||||||
|
|
||||||
|
Route::get('posts', [\App\Http\Controllers\Admin\PostController::class, 'index'])->name('posts.manage');
|
||||||
|
|
||||||
|
Route::get('posts/edit/{post_id}', [\App\Http\Controllers\Admin\PostController::class, 'edit'])->name('posts.manage.edit');
|
||||||
|
|
||||||
|
Route::get('posts/new', [\App\Http\Controllers\Admin\PostController::class, 'new'])->name('posts.manage.new');
|
||||||
|
|
||||||
Route::get('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'show'])->name('profile.show');
|
Route::get('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'show'])->name('profile.show');
|
||||||
Route::put('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'update'])->name('profile.update');
|
Route::put('profile', [\App\Http\Controllers\Admin\ProfileController::class, 'update'])->name('profile.update');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Route::get('/', [App\Http\Controllers\Front\HomeController::class, 'index'])->name('home');
|
||||||
|
|
||||||
|
Route::get('/{country}', [App\Http\Controllers\Front\HomeController::class, 'country'])->name('home.country');
|
||||||
|
|
||||||
|
Route::get('/{country}/posts', [App\Http\Controllers\Front\HomeController::class, 'all'])->name('home.country.posts');
|
||||||
|
|
||||||
|
Route::get('/{country}/posts/{post_slug}', [App\Http\Controllers\Front\HomeController::class, 'post'])->name('home.country.post');
|
||||||
|
|
||||||
|
Route::get('/{country}/{category}', [App\Http\Controllers\Front\HomeController::class, 'countryCategory'])->name('home.country.category');
|
||||||
|
|||||||
Reference in New Issue
Block a user