2022-08-07 12:48:05 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Filament\Resources\BiddersResource\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 VehiclesRelationManager extends RelationManager
|
|
|
|
{
|
|
|
|
protected static string $relationship = 'vehicles';
|
|
|
|
|
|
|
|
protected static ?string $recordTitleAttribute = 'owner';
|
|
|
|
|
|
|
|
public static function form(Form $form): Form
|
|
|
|
{
|
|
|
|
return $form
|
|
|
|
->schema([
|
|
|
|
Forms\Components\TextInput::make('owner')
|
|
|
|
->required()
|
|
|
|
->maxLength(255),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function table(Table $table): Table
|
|
|
|
{
|
|
|
|
return $table
|
|
|
|
->columns([
|
2022-09-12 07:57:09 -04:00
|
|
|
Tables\Columns\TextColumn::make('vehicleOwner.bidder_assigned_number')
|
|
|
|
->label('Number')
|
|
|
|
->sortable(),
|
|
|
|
Tables\Columns\TextColumn::make('year')
|
|
|
|
->label('Year')
|
|
|
|
->sortable(),
|
|
|
|
Tables\Columns\TextColumn::make('make')
|
|
|
|
->label('Make')
|
|
|
|
->sortable(),
|
|
|
|
Tables\Columns\TextColumn::make('model')
|
|
|
|
->label('Model')
|
|
|
|
->sortable(),
|
|
|
|
Tables\Columns\TextColumn::make('vehicleType.category_name')
|
|
|
|
->label('Type')
|
|
|
|
->sortable(),
|
|
|
|
Tables\Columns\BooleanColumn::make('doNotJudge')
|
|
|
|
->label('Judged?')
|
|
|
|
->sortable()
|
|
|
|
->falseIcon('heroicon-o-badge-check')
|
|
|
|
->trueIcon('heroicon-o-x-circle')
|
|
|
|
->trueColor('danger')
|
|
|
|
->falseColor('success'),
|
2022-08-07 12:48:05 -04:00
|
|
|
])
|
|
|
|
->filters([
|
|
|
|
//
|
|
|
|
])
|
|
|
|
->headerActions([
|
|
|
|
Tables\Actions\CreateAction::make(),
|
|
|
|
])
|
|
|
|
->actions([
|
|
|
|
Tables\Actions\EditAction::make(),
|
|
|
|
Tables\Actions\DeleteAction::make(),
|
|
|
|
])
|
|
|
|
->bulkActions([
|
|
|
|
Tables\Actions\DeleteBulkAction::make(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}
|