resources and relations

This commit is contained in:
2022-08-07 12:48:05 -04:00
parent 83a89329b8
commit 6e2bdee1c6
27 changed files with 897 additions and 6 deletions

View File

@ -12,6 +12,13 @@ use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Forms\Components\Select;
use App\Models\Vehicles;
use App\Models\CarShowCategory;
class CarShowWinnerResource extends Resource
{
@ -23,7 +30,14 @@ class CarShowWinnerResource extends Resource
{
return $form
->schema([
//
Select::make('vehicle')
->label('Vehicle')
->options(Vehicles::all()->pluck('owner', 'year', 'make', 'model', 'id'))
->searchable(),
Select::make('category')
->label('Category')
->options(CarShowCategory::all()->pluck('category_name', 'vehicle_type', 'id'))
->searchable(),
]);
}
@ -31,8 +45,9 @@ class CarShowWinnerResource extends Resource
{
return $table
->columns([
//
])
TextColumn::make('awardVehicle.owner')->label('Vehicle'),
TextColumn::make('awardCategory.category_name')->label('Category'),
])
->filters([
//
])