silent-auction/app/Filament/Resources/CheckoutResource/RelationManagers/BiddersRelationManager.php

63 lines
2.4 KiB
PHP
Raw Normal View History

2022-08-07 12:48:05 -04:00
<?php
namespace App\Filament\Resources\CheckoutResource\RelationManagers;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\RelationManagers\RelationManager;
use Filament\Resources\Table;
use Filament\Tables;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\SoftDeletingScope;
class BiddersRelationManager extends RelationManager
{
protected static string $relationship = 'bidders';
protected static ?string $recordTitleAttribute = 'bidder_num';
public static function form(Form $form): Form
{
return $form
->schema([
2022-09-28 07:52:27 -04:00
Forms\Components\Select::make('bidder_num')
->label('Number')
2022-08-07 12:48:05 -04:00
->required()
2022-09-28 07:52:27 -04:00
->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'),
]),
2022-08-07 12:48:05 -04:00
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
2022-09-28 07:52:27 -04:00
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'),
2022-08-07 12:48:05 -04:00
])
->filters([
//
])
->headerActions([
Tables\Actions\CreateAction::make(),
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\DeleteAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
}