88 lines
2.3 KiB
PHP
88 lines
2.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\BankResource\Pages;
|
|
use App\Modules\Bank\Models\Bank;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Forms\Form;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Tables;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class BankResource extends Resource
|
|
{
|
|
protected static ?string $model = Bank::class;
|
|
|
|
protected static ?string $navigationGroup = 'Settings';
|
|
|
|
protected static ?string $navigationIcon = 'heroicon-o-building-library';
|
|
|
|
public static function form(Form $form): Form
|
|
{
|
|
return $form
|
|
->schema([
|
|
TextInput::make('name'),
|
|
TextInput::make('bab'),
|
|
TextInput::make('hb'),
|
|
]);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('id')
|
|
->sortable(),
|
|
|
|
TextColumn::make('name')
|
|
->sortable()
|
|
->searchable(),
|
|
|
|
TextColumn::make('bab')
|
|
->sortable()
|
|
->searchable(),
|
|
|
|
TextColumn::make('hb')
|
|
->sortable()
|
|
->searchable(),
|
|
|
|
TextColumn::make('created_at')
|
|
->label('Created at')
|
|
->dateTime()
|
|
->sortable()
|
|
->sinceTooltip()
|
|
->formatStateUsing(fn (?Carbon $state) => $state?->format('H:i, d.m.Y')),
|
|
])
|
|
->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\ListBanks::route('/'),
|
|
'create' => Pages\CreateBank::route('/create'),
|
|
'edit' => Pages\EditBank::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|