silent-auction/app/Filament/Resources/BiddersResource.php

81 lines
2.8 KiB
PHP
Raw Normal View History

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;
protected static ?string $navigationIcon = 'heroicon-o-collection';
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'),
TextInput::make('bidder_phone')->label('Phone Number'),
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(),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListBidders::route('/'),
'create' => Pages\CreateBidders::route('/create'),
'edit' => Pages\EditBidders::route('/{record}/edit'),
];
}
}