resources and relation mgrs

This commit is contained in:
Russ Long 2022-09-12 07:57:09 -04:00
parent e484c0df98
commit 1629e22b63
6 changed files with 82 additions and 16 deletions

View File

@ -30,7 +30,16 @@ class CheckoutRelationManager extends RelationManager
{
return $table
->columns([
Tables\Columns\TextColumn::make('bidder_num'),
Tables\Columns\TextColumn::make('bidders.bidder_assigned_number')
->label('Bidder Number')
->sortable(),
Tables\Columns\TextColumn::make('winnertotal')
->label('Total Amount')
->money('usd', 'true')
->sortable(),
Tables\Columns\TextColumn::make('paymentMethod.pm_name')
->label('Payment Method')
->sortable(),
])
->filters([
//

View File

@ -30,7 +30,28 @@ class VehiclesRelationManager extends RelationManager
{
return $table
->columns([
Tables\Columns\TextColumn::make('owner'),
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'),
])
->filters([
//

View File

@ -30,7 +30,17 @@ class WinningBidsRelationManager extends RelationManager
{
return $table
->columns([
Tables\Columns\TextColumn::make('winning_bidder_num'),
Tables\Columns\TextColumn::make('items.item_assigned_num')
->label('Item Number')
->sortable(),
Tables\Columns\TextColumn::make('bidders.bidder_assigned_number')
->label('Bidder Number')
->sortable(),
Tables\Columns\TextColumn::make('winning_cost')
->label('Winning Bid Amt')
->money('usd', 'true')
->sortable(),
])
->filters([
//

View File

@ -27,7 +27,8 @@ class PaymentMethodsResource extends Resource
{
return $form
->schema([
//
TextInput::make('pm_name')
->label('Method Name'),
]);
}
@ -35,7 +36,9 @@ class PaymentMethodsResource extends Resource
{
return $table
->columns([
//
TextColumn::make('pm_name')
->label('Method Name')
->sortable(),
])
->filters([
//

View File

@ -33,19 +33,19 @@ class VehiclesResource extends Resource
return $form
->schema([
Select::make('owner')
->label('Owner')
->options(Bidders::all()->pluck('bidder_assigned_number', 'id'))
->searchable(),
->label('Owner')
->options(Bidders::all()->pluck('bidder_assigned_number', 'idbidders'))
->searchable(),
TextInput::make('year')
->label('Year'),
->label('Year'),
TextInput::make('make')
->label('Make'),
->label('Make'),
TextInput::make('model')
->label('Model'),
->label('Model'),
Select::make('type')
->label('Type')
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
->searchable(),
->label('Type')
->options(CarShowCategory::orderBy('category_name')->vehtype()->pluck('category_name', 'id'))
->searchable(),
]);
}

View File

@ -16,6 +16,11 @@ use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use App\Models\Bidders;
use App\Models\Items;
use Filament\Forms\Components\Select;
use function Ramsey\Uuid\v1;
class WinningBidsResource extends Resource
{
@ -29,7 +34,16 @@ class WinningBidsResource extends Resource
{
return $form
->schema([
//
Select::make('winning_item_num')
->label('Item')
->options(Items::orderBy('item_assigned_num')->pluck('item_assigned_num', 'iditems'))
->searchable(),
Select::make('winning_bidder_num')
->label('Bidder')
->options(Bidders::all()->pluck('bidder_assigned_number', 'idbidders'))
->searchable(),
TextInput::make('winning_cost')
->label('Winning Bid'),
]);
}
@ -37,7 +51,16 @@ class WinningBidsResource extends Resource
{
return $table
->columns([
//
TextColumn::make('items.item_assigned_num')
->label('Item Number')
->sortable(),
TextColumn::make('bidders.bidder_assigned_number')
->label('Bidder Number')
->sortable(),
TextColumn::make('winning_cost')
->label('Winning Bid Amt')
->money('usd', 'true')
->sortable(),
])
->filters([
//