Add navigationGroup to UrlLinkResource
This commit is contained in:
@@ -33,6 +33,9 @@ class UrlLinkResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationParentItem = 'Страницы';
|
protected static ?string $navigationParentItem = 'Страницы';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'Структура приложения';
|
||||||
|
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class MainController extends Controller
|
|||||||
$event_date_start = $today->format('Y-m-d');
|
$event_date_start = $today->format('Y-m-d');
|
||||||
$sliders = ClientMainSliderResource::collection(MainSlider::query()->where('is_active', true)->orderBy('sort', 'asc')->get());
|
$sliders = ClientMainSliderResource::collection(MainSlider::query()->where('is_active', true)->orderBy('sort', 'asc')->get());
|
||||||
$posts = PostThumbnailResource::collection(Post::query()
|
$posts = PostThumbnailResource::collection(Post::query()
|
||||||
->select('title', 'slug', 'authors', 'preview_text', 'category_id', 'preview', 'search_data', 'created_at')
|
->select('title', 'slug', 'authors', 'preview_text', 'category_id', 'preview', 'search_data', 'publish_at', 'created_at')
|
||||||
->with('category')
|
->with('category')
|
||||||
->where('publish_at', '<', Carbon::now())
|
->where('publish_at', '<', Carbon::now())
|
||||||
->where('status', '=', PostStatus::PUBLISHED)
|
->where('status', '=', PostStatus::PUBLISHED)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Resources;
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ class ClientPostListResource extends JsonResource
|
|||||||
'authors' => $this->authors,
|
'authors' => $this->authors,
|
||||||
'preview' => $this->preview,
|
'preview' => $this->preview,
|
||||||
'reading_time' => $this->reading_time,
|
'reading_time' => $this->reading_time,
|
||||||
'created_post' => $this->created_at->diffforhumans(),
|
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ class PostResource extends JsonResource
|
|||||||
'authors' => $this->authors,
|
'authors' => $this->authors,
|
||||||
'gallery' => $this->images,
|
'gallery' => $this->images,
|
||||||
'reading_time' => $this->reading_time,
|
'reading_time' => $this->reading_time,
|
||||||
'created_post' => $this->created_at->diffforhumans(),
|
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Resources;
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ class PostSearchResource extends JsonResource
|
|||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'slug' => $this->slug,
|
'slug' => $this->slug,
|
||||||
'created_post' => $this->created_at->diffforhumans(),
|
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Resources;
|
namespace App\Http\Resources;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@ class PostThumbnailResource extends JsonResource
|
|||||||
'category' => $this->category,
|
'category' => $this->category,
|
||||||
'authors' => $this->authors,
|
'authors' => $this->authors,
|
||||||
'preview' => $this->preview,
|
'preview' => $this->preview,
|
||||||
'created_post' => $this->created_at->diffforhumans(),
|
'created_post' => Carbon::parse($this->publish_at)->diffforhumans(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Foundation\Inspiring;
|
use Illuminate\Foundation\Inspiring;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -17,3 +18,9 @@ use Illuminate\Support\Facades\Artisan;
|
|||||||
Artisan::command('inspire', function () {
|
Artisan::command('inspire', function () {
|
||||||
$this->comment(Inspiring::quote());
|
$this->comment(Inspiring::quote());
|
||||||
})->purpose('Display an inspiring quote');
|
})->purpose('Display an inspiring quote');
|
||||||
|
|
||||||
|
if ('production' === App::environment()) {
|
||||||
|
Artisan::comman('migrate:fresh', function () {
|
||||||
|
$this->comment('You are not allowed to do this in production.');
|
||||||
|
})->describe('Override default command in production.');
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user