add 'info' field as an array in DirectionStudy model; update DirectionStudyResource to include tabs for main information and admission details; modify Show.vue to display direction study information; enhance PageItemBlock.vue for better breadcrumb display

This commit is contained in:
F4ilji
2025-07-27 21:33:00 +05:00
parent cb95af3c46
commit 8b2f9e99f0
5 changed files with 134 additions and 84 deletions
@@ -2,14 +2,25 @@
namespace App\Filament\Resources;
use App\Containers\Article\Enums\PostStatus;
use App\Containers\Article\Models\Category;
use App\Containers\Education\Models\DirectionStudy;
use App\Containers\Widget\Models\Slider;
use App\Filament\Components\Forms\ItemForm\Pages\ContentBuilderItem;
use App\Filament\Resources\DirectionStudyResource\Pages;
use App\Ship\Enums\Education\LevelEducational;
use Filament\Forms;
use Filament\Forms\Components\ColorPicker;
use Filament\Forms\Components\DateTimePicker;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\Section;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\SpatieTagsInput;
use Filament\Forms\Components\Tabs;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\ToggleButtons;
use Filament\Forms\Form;
use Filament\Resources\Resource;
use Filament\Tables;
@@ -36,50 +47,65 @@ class DirectionStudyResource extends Resource
->description('Заполните основные данные о направлении подготовки')
->collapsible()
->schema([
Grid::make(2)
->schema([
TextInput::make('name')
->label('Название направления')
->required()
->maxLength(255)
->placeholder('Например: Информатика и вычислительная техника')
->live(onBlur: true)
->afterStateUpdated(function (string $operation, ?string $state, Forms\Set $set) {
$set('slug', Str::slug($state));
})
->helperText('Полное название направления подготовки'),
Tabs::make('Tabs')
->tabs([
Tabs\Tab::make('Основная информация')
->icon('heroicon-o-information-circle')
->schema([
Grid::make(2)
->schema([
TextInput::make('name')
->label('Название направления')
->required()
->maxLength(255)
->placeholder('Например: Информатика и вычислительная техника')
->live(onBlur: true)
->afterStateUpdated(function (string $operation, ?string $state, Forms\Set $set) {
$set('slug', Str::slug($state));
})
->helperText('Полное название направления подготовки'),
TextInput::make('uuid')
->label('uuid')
->required()
->maxLength(255)
->unique(ignoreRecord: true)
->helperText('UUID'),
TextInput::make('uuid')
->label('uuid')
->required()
->maxLength(255)
->unique(ignoreRecord: true)
->helperText('UUID'),
TextInput::make('slug')
->label('URL-идентификатор')
->required()
->readOnly()
->maxLength(255)
->unique(ignoreRecord: true)
->helperText('Человеко-понятный URL для направления'),
TextInput::make('slug')
->label('URL-идентификатор')
->required()
->readOnly()
->maxLength(255)
->unique(ignoreRecord: true)
->helperText('Человеко-понятный URL для направления'),
TextInput::make('code')
->label('Код направления')
->required()
->maxLength(50)
->placeholder('Например: 09.03.01')
->helperText('Код направления по ФГОС'),
TextInput::make('code')
->label('Код направления')
->required()
->maxLength(50)
->placeholder('Например: 09.03.01')
->helperText('Код направления по ФГОС'),
Select::make('lvl_edu')
->label('Уровень образования')
->options(LevelEducational::class)
->required()
->native(false)
->placeholder('Выберите уровень')
->helperText('Выберите уровень образовательной программы'),
]),
Select::make('lvl_edu')
->label('Уровень образования')
->options(LevelEducational::class)
->required()
->native(false)
->placeholder('Выберите уровень')
->helperText('Выберите уровень образовательной программы'),
]),
]),
Tabs\Tab::make('Информация для направления')
->icon('heroicon-o-document-text')
->schema([
ContentBuilderItem::getItem('info')
->required()
->helperText('Создайте содержимое новости используя конструктор'),
]),
])
->persistTabInQueryString(),
]),
]);
}