Enhance Group and Document resources; add leader and helper teacher relationships, update navigation icons, and adjust navigation sorting.

This commit is contained in:
2025-08-30 17:21:47 +05:00
parent 18e425f533
commit 710554a28d
24 changed files with 760 additions and 11 deletions

View File

@@ -12,7 +12,6 @@ use App\Models\Group;
use BackedEnum;
use Filament\Resources\Resource;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Illuminate\Contracts\Support\Htmlable;
@@ -20,8 +19,6 @@ class GroupResource extends Resource
{
protected static ?string $model = Group::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
protected static ?string $navigationLabel = 'Toparlar';
protected static ?string $pluralLabel = 'Toparlar';
@@ -32,7 +29,7 @@ class GroupResource extends Resource
public static function getNavigationIcon(): string | BackedEnum | Htmlable | null
{
return 'heroicon-o-user-group';
return 'icon-flight-takeoff';
}
public static function form(Schema $schema): Schema

View File

@@ -2,8 +2,10 @@
namespace App\Filament\Resources\Groups\Schemas;
use App\Models\Teacher;
use Carbon\Carbon;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Select;
use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Schema;
@@ -22,6 +24,19 @@ class GroupForm
DatePicker::make('end_date')
->label('Gutarýan senesi')
->required(),
Select::make('leader_teacher_id')
->label('Topar başy')
->options(Teacher::query()->pluck('name', 'id'))
->searchable()
->required(),
Select::make('helperTeachers')
->label('Topar kömekçileri')
->relationship('helperTeachers', 'name')
->multiple()
->searchable()
->preload(),
]);
}
}

View File

@@ -14,6 +14,11 @@ class GroupsTable
{
return $table
->columns([
TextColumn::make('leaderTeacher.name')
->label('Topar başy')
->searchable()
->sortable(),
TextColumn::make('start_date')
->label('Başlanýan senesi')
->date()