Repo rules
- This provisioning code is designed to run on Manjaro Linux.
This document outlines the standard conventions to be followed when creating Eloquent models and Filament Resources in this project.
Loading actions...
- This provisioning code is designed to run on Manjaro Linux.
Project Summary:
This guide outlines the project structure and provides step-by-step instructions for setting up the Geometry Tutor application.
This document outlines the standard conventions to be followed when creating Eloquent models and Filament Resources in this project.
Universal Fields for All Models
id (Primary Key, auto-incrementing)uuid (Universally Unique Identifier)created_atupdated_atTraits
HasUuid trait to ensure UUID functionality is automatically handled.
use App\Traits\HasUuid;
class YourModel extends Model
{
use HasUuid;
}
Enums
App\Enums)protected $casts = [
'status' => \App\Enums\StatusEnum::class,
];
Please ensure these conventions are followed across all modules to maintain consistency and facilitate code maintenance.
All Filament resources must be created using the custom Artisan command:
php artisan make:modular-filament-resource <ModelName> --fields="GroupOne,GroupTwo,GroupThree" [--generate] [--model] [--migration] ...
Do not use the default make:filament-resource. Every resource should follow the modular pattern provided by the make:modular-filament-resource command.
app/Models/<ModelName>.php--fields option in the commandphp artisan make:modular-filament-resource User --fields="Basic Info,Personal Info,Account Settings,Contact Info"
For a model named User, the following structure should be created:
app/
└── Filament/
└── Resources/
├── UserResource.php
└── UserResource/
├── FormSchema.php
├── TableSchema.php
├── Actions.php
└── Fields/
├── BasicInfo.php
├── PersonalInfo.php
├── AccountSettings.php
└── ContactInfo.php
Each group in --fields generates a corresponding file inside Fields/:
Filament\Forms\Components\Section::make('GroupName')->schema([])->columns(2)TableSchema.php:$fillable->toggleable()
->hidden()
TextColumn::make('email')
->toggleable()
->hidden();
Use a centralized actions handler:
->actions(Actions::getActions())
->bulkActions(Actions::getBulkActions())
Define them in Actions.php.
UserResource.phpActions.php--fields argument; even a single group must be named| Element | Rule |
|---|---|
| Resource File | Only basic method overrides, no logic inside |
| Field Groups | Each group = 1 file under Fields/, should return a schema |
| Table Columns | Auto-generated, toggleable, hidden if nullable |
| Actions | Defined in Actions.php using getActions() and getBulkActions() |
| Consistency | All files must follow PSR-4 naming and proper namespaces |
By following these rules, your Filament resources will remain clean, maintainable, and modular—ready for future microservice conversion if needed.