A demonstration of managing expenses and income by categories with chart visualizations on the dashboard.
This example project has two navigation groups:
In these groups, we have Filament Resource to manage expense or income and their categories.
These resources have identical forms and tables. The table is sorted by entry date in descending order.
Here is the code for the expense and income form and table:
app/Filament/Resources/Incomes/Schemas/IncomeForm.php:
public static function configure(Schema $schema): Schema{ return $schema ->components([ DatePicker::make('entry_date') ->required(), TextInput::make('amount') ->numeric() ->required() ->step('0.01'), Select::make('income_category_id') ->required() ->columnSpanFull() ->relationship('incomeCategory', 'name'), TextInput::make('description') ->columnSpanFull(), ]);}
app/Filament/Resources/Incomes/Tables/IncomesTable.php:
public static function configure(Table $table): Table{ return $table ->columns([ TextColumn::make('entry_date') ->date(), TextColumn::make('amount') ->money(), TextColumn::make('incomeCategory.name'), ]) ->filters([ TrashedFilter::make(), ]) ->recordActions([ EditAction::make(), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ForceDeleteBulkAction::make(), RestoreBulkAction::make(), ]), ]) ->defaultSort('entry_date', 'desc');}