silent-auction/app/Filament/Resources/CheckoutResource.php
2022-09-04 13:57:38 -04:00

78 lines
2.1 KiB
PHP

<?php
namespace App\Filament\Resources;
use App\Filament\Resources\CheckoutResource\Pages;
use App\Filament\Resources\CheckoutResource\RelationManagers;
use App\Models\Checkout;
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;
use Filament\Tables\Columns\BooleanColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
class CheckoutResource extends Resource
{
protected static ?string $model = Checkout::class;
protected static ?string $navigationIcon = 'heroicon-o-collection';
protected static ?string $navigationGroup = 'Silent Auction';
public static function form(Form $form): Form
{
return $form
->schema([
//
]);
}
public static function table(Table $table): Table
{
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([
//
])
->actions([
Tables\Actions\EditAction::make(),
])
->bulkActions([
Tables\Actions\DeleteBulkAction::make(),
]);
}
public static function getRelations(): array
{
return [
//
];
}
public static function getPages(): array
{
return [
'index' => Pages\ListCheckouts::route('/'),
'create' => Pages\CreateCheckout::route('/create'),
'edit' => Pages\EditCheckout::route('/{record}/edit'),
];
}
}