more resource setup

This commit is contained in:
Russ Long 2022-09-28 07:52:27 -04:00
parent ef96dc7cd8
commit a13c9be41c
4 changed files with 52 additions and 8 deletions

View File

@ -9,6 +9,7 @@ use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
use App\Models\CarShowCategory;
class VehiclesRelationManager extends RelationManager
{
@ -20,9 +21,16 @@ class VehiclesRelationManager extends RelationManager
{
return $form
->schema([
Forms\Components\TextInput::make('owner')
->required()
->maxLength(255),
Forms\Components\TextInput::make('year')
->label('Year'),
Forms\Components\TextInput::make('make')
->label('Make'),
Forms\Components\TextInput::make('model')
->label('Model'),
Forms\Components\Select::make('type')
->label('Type')
->options(CarShowCategory::vehtype()->pluck('category_name', 'id'))
->searchable(),
]);
}

View File

@ -15,7 +15,10 @@ use Illuminate\Database\Eloquent\SoftDeletingScope;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Toggle;
use App\Models\Bidders;
use App\Models\PaymentMethods;
class CheckoutResource extends Resource
{
@ -29,7 +32,27 @@ class CheckoutResource extends Resource
{
return $form
->schema([
//
Select::make('bidder_num')
->label('Bidder')
->options(
Bidders::orderBy('bidder_assigned_number')
->pluck('bidder_assigned_number', 'idbidders')
)
->searchable(),
TextInput::make('winnertotal')
->label('Total Amount')
->mask(
fn (TextInput\Mask $mask) => $mask->money(
prefix: '$',
thousandsSeparator: ',',
decimalPlaces: 2,
isSigned: false
)
),
Select::make('payment_method')
->label('Payment Method')
->options(PaymentMethods::all()->pluck('pm_name', 'pm_id'))
->searchable(),
]);
}

View File

@ -20,9 +20,20 @@ class BiddersRelationManager extends RelationManager
{
return $form
->schema([
Forms\Components\TextInput::make('bidder_num')
Forms\Components\Select::make('bidder_num')
->label('Number')
->required()
->maxLength(255),
->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'),
]),
]);
}
@ -30,7 +41,9 @@ class BiddersRelationManager extends RelationManager
{
return $table
->columns([
Tables\Columns\TextColumn::make('bidder_num'),
Tables\Columns\TextColumn::make('bidder_fname')->label('First Name'),
Tables\Columns\TextColumn::make('bidder_lname')->label('Last Name'),
Tables\Columns\TextColumn::make('bidder_assigned_number')->label('Number'),
])
->filters([
//

View File

@ -28,7 +28,7 @@ class Checkout extends Model
public function bidders()
{
return $this->belongsTo(Bidders::class, 'bidder_num');
return $this->belongsTo(Bidders::class, 'bidder_num', 'idbidders');
}
public function paymentMethod()