2022-08-06 15:39:24 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
|
|
|
|
use App\Filament\Resources\BiddersResource\Pages;
|
|
|
|
use App\Filament\Resources\BiddersResource\RelationManagers;
|
|
|
|
use App\Models\Bidders;
|
|
|
|
use Filament\Forms;
|
|
|
|
use Filament\Resources\Form;
|
|
|
|
use Filament\Resources\Resource;
|
|
|
|
use Filament\Resources\Table;
|
|
|
|
use Filament\Tables;
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
2022-08-07 12:48:05 -04:00
|
|
|
use Filament\Tables\Columns\TextColumn;
|
|
|
|
use Filament\Forms\Components\TextInput;
|
2022-08-06 15:39:24 -04:00
|
|
|
|
|
|
|
class BiddersResource extends Resource
|
|
|
|
{
|
|
|
|
protected static ?string $model = Bidders::class;
|
|
|
|
|
2022-09-04 13:57:38 -04:00
|
|
|
protected static ?string $recordTitleAttribute = 'idbidders';
|
|
|
|
|
2022-08-06 15:39:24 -04:00
|
|
|
protected static ?string $navigationIcon = 'heroicon-o-collection';
|
|
|
|
|
2022-08-07 13:07:31 -04:00
|
|
|
protected static ?string $navigationGroup = 'Silent Auction';
|
|
|
|
|
2022-08-06 15:39:24 -04:00
|
|
|
public static function form(Form $form): Form
|
|
|
|
{
|
|
|
|
return $form
|
|
|
|
->schema([
|
2022-08-07 12:48:05 -04:00
|
|
|
TextInput::make('bidder_fname')->label('First Name'),
|
|
|
|
TextInput::make('bidder_lname')->label('Last Name'),
|
|
|
|
TextInput::make('bidder_addr')->label('Address'),
|
|
|
|
TextInput::make('bidder_city')->label('City'),
|
|
|
|
TextInput::make('bidder_state')->label('State'),
|
|
|
|
TextInput::make('bidder_zip')->label('Zip'),
|
2023-03-16 13:44:06 -04:00
|
|
|
TextInput::make('bidder_phone')->label('Phone Number')
|
|
|
|
->mask(fn (TextInput\Mask $mask) => $mask->pattern('+{7}(000)000-00-00')),
|
2022-08-07 12:48:05 -04:00
|
|
|
TextInput::make('bidder_email')->label('Email'),
|
|
|
|
TextInput::make('bidder_assigned_number')->label('Assigned Number'),
|
2022-08-06 15:39:24 -04:00
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function table(Table $table): Table
|
|
|
|
{
|
|
|
|
return $table
|
|
|
|
->columns([
|
2022-08-07 12:48:05 -04:00
|
|
|
TextColumn::make('bidder_assigned_number')->sortable()->label('Assigned Number'),
|
|
|
|
TextColumn::make('bidder_fname')->sortable()->label('First Name'),
|
|
|
|
TextColumn::make('bidder_lname')->sortable()->label('Last Name'),
|
|
|
|
TextColumn::make('bidder_addr')->label('Address'),
|
|
|
|
TextColumn::make('bidder_city')->label('City'),
|
|
|
|
TextColumn::make('bidder_state')->label('State'),
|
|
|
|
TextColumn::make('bidder_zip')->label('Zip'),
|
|
|
|
TextColumn::make('bidder_phone')->label('Phone Number'),
|
|
|
|
TextColumn::make('bidder_email')->label('Email'),
|
2022-08-06 15:39:24 -04:00
|
|
|
])
|
|
|
|
->filters([
|
|
|
|
//
|
|
|
|
])
|
|
|
|
->actions([
|
|
|
|
Tables\Actions\EditAction::make(),
|
|
|
|
])
|
|
|
|
->bulkActions([
|
|
|
|
Tables\Actions\DeleteBulkAction::make(),
|
2022-09-26 19:12:15 -04:00
|
|
|
])
|
|
|
|
->defaultSort('bidder_assigned_number');
|
2022-08-06 15:39:24 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getRelations(): array
|
|
|
|
{
|
|
|
|
return [
|
2022-09-04 13:57:38 -04:00
|
|
|
RelationManagers\VehiclesRelationManager::class,
|
|
|
|
RelationManagers\CheckoutRelationManager::class,
|
|
|
|
RelationManagers\WinningBidsRelationManager::class,
|
2022-08-06 15:39:24 -04:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function getPages(): array
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'index' => Pages\ListBidders::route('/'),
|
|
|
|
'create' => Pages\CreateBidders::route('/create'),
|
|
|
|
'edit' => Pages\EditBidders::route('/{record}/edit'),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|