forked from TFMM/silent-auction
91 lines
2.7 KiB
PHP
91 lines
2.7 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\ItemsResource\Pages;
|
|
use App\Filament\Resources\ItemsResource\RelationManagers;
|
|
use App\Models\Items;
|
|
use UnitEnum;
|
|
use BackedEnum;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Tables\Table;
|
|
use Filament\Tables;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Components\Toggle;
|
|
|
|
class ItemsResource extends Resource
|
|
{
|
|
protected static ?string $model = Items::class;
|
|
|
|
protected static string | BackedEnum | null $navigationIcon = 'heroicon-o-rectangle-stack';
|
|
|
|
protected static string | UnitEnum | null $navigationGroup = 'Silent Auction';
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('item_assigned_num')
|
|
->label('Item Number'),
|
|
TextInput::make('item_desc')
|
|
->label('Description'),
|
|
TextInput::make('item_min_bid')
|
|
->label('Minimum Bid'),
|
|
TextInput::make('item_est_value')
|
|
->label('Estimated Value'),
|
|
]);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('item_assigned_num')
|
|
->label('Item Number')
|
|
->sortable(),
|
|
TextColumn::make('item_desc')
|
|
->label('Description'),
|
|
TextColumn::make('item_min_bid')
|
|
->label('Minimum Bid')
|
|
->money('USD')
|
|
->sortable(),
|
|
TextColumn::make('item_est_value')
|
|
->label('Estimated Value')
|
|
->money('USD')
|
|
->sortable(),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->actions([
|
|
Tables\Actions\EditAction::make(),
|
|
])
|
|
->bulkActions([
|
|
Tables\Actions\BulkActionGroup::make([
|
|
Tables\Actions\DeleteBulkAction::make(),
|
|
]),
|
|
])
|
|
->defaultSort('item_assigned_num');
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ListItems::route('/'),
|
|
'create' => Pages\CreateItems::route('/create'),
|
|
'edit' => Pages\EditItems::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|