65 lines
1.7 KiB
PHP
65 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\ResumeResource\RelationManagers;
|
|
|
|
use Filament\Forms\Components\DatePicker;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\RelationManagers\RelationManager;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
final class WorksExperienceRelationManager extends RelationManager
|
|
{
|
|
protected static string $relationship = 'workExperiences';
|
|
|
|
public function form(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
TextInput::make('name')
|
|
->required(),
|
|
|
|
TextInput::make('position')
|
|
->required(),
|
|
|
|
TextInput::make('url')
|
|
->url(),
|
|
|
|
DatePicker::make('start_date')
|
|
->required(),
|
|
|
|
DatePicker::make('end_date'),
|
|
|
|
TextInput::make('summary'),
|
|
]);
|
|
}
|
|
|
|
public function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->recordTitleAttribute('name')
|
|
->columns([
|
|
TextColumn::make('name'),
|
|
TextColumn::make('position'),
|
|
TextColumn::make('start_date')->date(),
|
|
TextColumn::make('end_date')->date(),
|
|
])
|
|
->headerActions([
|
|
Tables\Actions\CreateAction::make(),
|
|
])
|
|
->actions([
|
|
Tables\Actions\EditAction::make(),
|
|
Tables\Actions\DeleteAction::make(),
|
|
])
|
|
->bulkActions([
|
|
Tables\Actions\BulkActionGroup::make([
|
|
Tables\Actions\DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
}
|