vehresource form
This commit is contained in:
parent
f4a19837bb
commit
d4a3fb430b
@ -15,7 +15,10 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|||||||
use Filament\Tables\Columns\BooleanColumn;
|
use Filament\Tables\Columns\BooleanColumn;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\Toggle;
|
use Filament\Forms\Components\Toggle;
|
||||||
|
use App\Models\Bidders;
|
||||||
|
use App\Models\CarShowCategory;
|
||||||
|
|
||||||
class VehiclesResource extends Resource
|
class VehiclesResource extends Resource
|
||||||
{
|
{
|
||||||
@ -29,7 +32,20 @@ class VehiclesResource extends Resource
|
|||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
->schema([
|
->schema([
|
||||||
//
|
Select::make('owner')
|
||||||
|
->label('Owner')
|
||||||
|
->options(Bidders::all()->pluck('bidder_assigned_number', 'id'))
|
||||||
|
->searchable(),
|
||||||
|
TextInput::make('year')
|
||||||
|
->label('Year'),
|
||||||
|
TextInput::make('make')
|
||||||
|
->label('Make'),
|
||||||
|
TextInput::make('model')
|
||||||
|
->label('Model'),
|
||||||
|
Select::make('type')
|
||||||
|
->label('Type')
|
||||||
|
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
|
||||||
|
->searchable(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +96,10 @@ class VehiclesResource extends Resource
|
|||||||
public static function getRelations(): array
|
public static function getRelations(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
//
|
RelationManagers\CarShowWinnerRelationManager::class,
|
||||||
|
RelationManagers\VehicleOwnerRelationManager::class,
|
||||||
|
RelationManagers\VehicleScoresRelationManager::class,
|
||||||
|
RelationManagers\VehicleTypeRelationManager::class,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,4 +31,9 @@ class CarShowCategory extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasMany(CarShowWinner::class, 'category');
|
return $this->hasMany(CarShowWinner::class, 'category');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeVehtype($query)
|
||||||
|
{
|
||||||
|
return $query->where('vehicle_type', 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user