You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
77 lines
2.0 KiB
PHP
77 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\PackingSlipResource\Pages;
|
|
use App\Models\PackingSlip;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class PackingSlipResource extends Resource
|
|
{
|
|
protected static ?string $model = PackingSlip::class;
|
|
|
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
|
|
|
protected static ?string $navigationGroup = 'Production';
|
|
|
|
public static function form(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
//
|
|
]);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('date_received')
|
|
->sortable()
|
|
->searchable(),
|
|
TextColumn::make('order.customer_po')
|
|
->weight('bold')
|
|
->color('code')
|
|
->sortable()
|
|
->searchable(),
|
|
TextColumn::make('contents'),
|
|
TextColumn::make('amount'),
|
|
TextColumn::make('order.customer.company_name')
|
|
->sortable()
|
|
->searchable(),
|
|
])
|
|
->defaultSort('date_received', 'desc')
|
|
->filters([
|
|
//
|
|
])
|
|
->actions([
|
|
Tables\Actions\EditAction::make(),
|
|
])
|
|
->bulkActions([
|
|
Tables\Actions\BulkActionGroup::make([
|
|
Tables\Actions\DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [
|
|
//
|
|
];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ListPackingSlips::route('/'),
|
|
'create' => Pages\CreatePackingSlip::route('/create'),
|
|
'edit' => Pages\EditPackingSlip::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|