Asset Stock Management

Filament 4
Also available in Filament 3 version

Shows how to create a simple stock management application with item export/import and transaction logging for stock changes.

P38nUYdSkxw8Hjv7kiPw9vPF8ODNkw-metaU2NyZWVuc2hvdCAyMDIzLTEwLTE3IGF0IDA3LjIyLjU4LnBuZw==-

Get the Source Code:

How it works

We have a simple resource to manage categories where the create and edit form opens in a modal. For category, we only have one field, name. Here is the code for CategoryResource:

class CategoryResource extends Resource
{
protected static ?string $model = Category::class;
 
protected static string | \BackedEnum | null $navigationIcon = Heroicon::OutlinedRectangleStack;
 
public static function form(Schema $schema): Schema
{
return CategoryForm::configure($schema);
}
 
public static function table(Table $table): Table
{
return CategoriesTable::configure($table);
}
 
public static function getPages(): array
{
return [
'index' => ManageCategories::route('/'),
];
}
}

Transactions resource manages transactions for an item. We can only create a new transaction.

The form of transaction is reused in the relation manager for ItemResource. We don't need a select input in the relation manager, so the hiddenOn() method is used where the Relation Manager class is passed as a parameter.

The amount text input has a column span of full only in the Relation Manager. Here is the code for the form in the TransactionResource:

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 152 Premium Examples for $99