fixing search module, and schedule module

This commit is contained in:
F4ilji
2025-04-14 19:24:18 +05:00
parent c27c1c36c1
commit cac319fa81
25 changed files with 470 additions and 257 deletions
@@ -65,6 +65,11 @@ class EducationalGroupResource extends Resource
]);
}
public static function getEloquentQuery(): Builder
{
return parent::getEloquentQuery()->with('faculty');
}
public static function table(Table $table): Table
{
return $table
@@ -81,14 +86,11 @@ class EducationalGroupResource extends Resource
->searchable()
->description(fn ($record) => $record->faculty->title ?? ''),
BadgeColumn::make('education_form_id')
TextColumn::make('education_form_id')
->label('Форма обучения')
->formatStateUsing(fn ($state) => FormEducation::tryFrom($state)?->label())
->color(fn ($state) => match($state) {
FormEducation::FULL_TIME->value => 'success',
FormEducation::PART_TIME->value => 'warning',
default => 'gray',
})
->badge()
->formatStateUsing(fn ($state) => FormEducation::tryFrom($state)?->getLabel())
->color(fn ($state) => FormEducation::tryFrom($state)?->getColor())
->sortable(),
TextColumn::make('created_at')
@@ -97,6 +99,7 @@ class EducationalGroupResource extends Resource
->sortable()
->toggleable(),
])
->filters([
Tables\Filters\SelectFilter::make('faculty_id')
->label('Факультет')