2022-08-06 19:02:21 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Filament\Resources\CarShowCategoryResource\RelationManagers;
|
|
|
|
|
|
|
|
use Filament\Forms;
|
|
|
|
use Filament\Resources\Form;
|
|
|
|
use Filament\Resources\RelationManagers\RelationManager;
|
|
|
|
use Filament\Resources\Table;
|
|
|
|
use Filament\Tables;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
|
|
|
|
class VehicleRelationManager extends RelationManager
|
|
|
|
{
|
|
|
|
protected static string $relationship = 'vehicle';
|
|
|
|
|
2022-08-06 19:19:33 -04:00
|
|
|
protected static ?string $recordTitleAttribute = 'id';
|
2022-08-06 19:02:21 -04:00
|
|
|
|
2022-08-07 09:01:34 -04:00
|
|
|
protected static ?string $inverseRelationship = 'vehicleType';
|
2022-08-07 08:47:36 -04:00
|
|
|
|
2022-08-06 19:02:21 -04:00
|
|
|
public static function form(Form $form): Form
|
|
|
|
{
|
|
|
|
return $form
|
|
|
|
->schema([
|
2022-08-06 19:19:33 -04:00
|
|
|
Forms\Components\TextInput::make('id')
|
2022-08-06 19:02:21 -04:00
|
|
|
->required()
|
|
|
|
->maxLength(255),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function table(Table $table): Table
|
|
|
|
{
|
|
|
|
return $table
|
|
|
|
->columns([
|
2022-08-06 19:19:33 -04:00
|
|
|
Tables\Columns\TextColumn::make('id'),
|
2022-08-06 19:02:21 -04:00
|
|
|
Tables\Columns\TextColumn::make('owner'),
|
|
|
|
Tables\Columns\TextColumn::make('year'),
|
|
|
|
Tables\Columns\TextColumn::make('make'),
|
|
|
|
Tables\Columns\TextColumn::make('model'),
|
|
|
|
])
|
|
|
|
->filters([
|
|
|
|
//
|
|
|
|
])
|
|
|
|
->headerActions([
|
|
|
|
Tables\Actions\CreateAction::make(),
|
2022-08-07 10:35:25 -04:00
|
|
|
Tables\Actions\AssociateAction::make(),
|
2022-08-06 19:02:21 -04:00
|
|
|
])
|
|
|
|
->actions([
|
|
|
|
Tables\Actions\EditAction::make(),
|
|
|
|
Tables\Actions\DeleteAction::make(),
|
2022-08-07 10:35:25 -04:00
|
|
|
Tables\Actions\DissociateAction::make(),
|
2022-08-06 19:02:21 -04:00
|
|
|
])
|
|
|
|
->bulkActions([
|
|
|
|
Tables\Actions\DeleteBulkAction::make(),
|
2022-08-07 10:35:25 -04:00
|
|
|
Tables\Actions\DissociateBulkAction::make(),
|
2022-08-06 19:02:21 -04:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|