feat: tambah Filament 5 resources dengan schemas dan tables
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\CashRecords;
|
||||
|
||||
use App\Filament\Resources\CashRecords\Pages\CreateCashRecord;
|
||||
use App\Filament\Resources\CashRecords\Pages\EditCashRecord;
|
||||
use App\Filament\Resources\CashRecords\Pages\ListCashRecords;
|
||||
use App\Filament\Resources\CashRecords\Schemas\CashRecordForm;
|
||||
use App\Filament\Resources\CashRecords\Tables\CashRecordsTable;
|
||||
use App\Models\CashRecord;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class CashRecordResource extends Resource
|
||||
{
|
||||
protected static ?string $model = CashRecord::class;
|
||||
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-banknotes';
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Keuangan';
|
||||
protected static ?string $modelLabel = 'Transaksi Kas';
|
||||
|
||||
public static function form(Schema $form): Schema
|
||||
{
|
||||
return CashRecordForm::configure($form);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return CashRecordsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListCashRecords::route('/'),
|
||||
'create' => CreateCashRecord::route('/create'),
|
||||
'edit' => EditCashRecord::route('/{record}/edit'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user