resource setup

This commit is contained in:
2022-09-04 13:57:38 -04:00
parent 8f95e68e61
commit e484c0df98
10 changed files with 66 additions and 9 deletions

View File

@ -19,6 +19,8 @@ class BiddersResource extends Resource
{
protected static ?string $model = Bidders::class;
protected static ?string $recordTitleAttribute = 'idbidders';
protected static ?string $navigationIcon = 'heroicon-o-collection';
protected static ?string $navigationGroup = 'Silent Auction';
@ -67,7 +69,9 @@ class BiddersResource extends Resource
public static function getRelations(): array
{
return [
//
RelationManagers\VehiclesRelationManager::class,
RelationManagers\CheckoutRelationManager::class,
RelationManagers\WinningBidsRelationManager::class,
];
}

View File

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

View File

@ -37,7 +37,19 @@ class ItemsResource extends Resource
{
return $table
->columns([
//
TextColumn::make('item_assigned_num')
->label('Item Number')
->sortable(),
TextColumn::make('item_desc')
->label('Description'),
TextColumn::make('item_min_bid')
->label('Minimum Bid')
->money('usd', 'true')
->sortable(),
TextColumn::make('item_est_value')
->label('Estimated Value')
->money('usd', 'true')
->sortable(),
])
->filters([
//

View File

@ -22,7 +22,18 @@ class VehicleOwnerRelationManager extends RelationManager
->schema([
Forms\Components\Select::make('bidder_assigned_number')
->label('Number')
->required(),
->required()
->createOptionForm([
Forms\Components\TextInput::make('bidder_fname')->label('First Name'),
Forms\Components\TextInput::make('bidder_lname')->label('Last Name'),
Forms\Components\TextInput::make('bidder_addr')->label('Address'),
Forms\Components\TextInput::make('bidder_city')->label('City'),
Forms\Components\TextInput::make('bidder_state')->label('State'),
Forms\Components\TextInput::make('bidder_zip')->label('Zip'),
Forms\Components\TextInput::make('bidder_phone')->label('Phone Number'),
Forms\Components\TextInput::make('bidder_email')->label('Email'),
Forms\Components\TextInput::make('bidder_assigned_number')->label('Assigned Number'),
]),
]);
}

View File

@ -9,20 +9,26 @@ use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use App\Models\CarShowCategory;
class VehicleTypeRelationManager extends RelationManager
{
protected static string $relationship = 'vehicleType';
protected static ?string $recordTitleAttribute = 'type';
protected static ?string $recordTitleAttribute = 'id';
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('category_name')
Forms\Components\Select::make('category_name')
->required()
->maxLength(255),
->searchable()
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
->createOptionForm([
Forms\Components\TextInput::make('category_name'),
Forms\Components\Toggle::make('vehicle_type')->inline(false),
]),
]);
}