Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Architect Laravel Package

lartisan/filament-architect

View on GitHub
Deep Wiki
Context7

Getting Started

Minimal Setup

  1. Installation:

    composer require lartisan/filament-architect
    

    Publish the package configuration:

    php artisan vendor:publish --provider="Lartisan\FilamentArchitect\FilamentArchitectServiceProvider"
    
  2. First Use Case:

    • Access the Filament admin panel.
    • Navigate to Tools > Filament Architect (or the configured route).
    • Click "Create New Resource" and follow the step-by-step wizard to generate:
      • Eloquent model + migration
      • Filament resource (CRUD panel)
      • Factory, seeder, and API resource (if enabled in config)

Key Configuration

Check config/filament-architect.php for:

  • Default table/column names
  • Whether to generate factories, seeders, API resources
  • Customizable field mappings (e.g., created_atdate)

Implementation Patterns

Workflow: Rapid CRUD Generation

  1. Wizard-Driven Creation:

    • Select a model name → Define fields (text, select, relationship, etc.).
    • Configure relationships (belongsTo, hasMany) via dropdowns.
    • Preview and generate the resource.
  2. Field Customization:

    • Use the "Advanced Options" tab to:
      • Set validation rules (e.g., required|email).
      • Configure Filament-specific attributes (e.g., sortable, searchable).
      • Add custom logic via state() or visible() closures.
  3. Post-Generation:

    • Extend the generated resource by overriding methods in app/Filament/Resources/{ResourceName}Resource.php:
      public static function table(Table $table): Table
      {
          return parent::table($table)
              ->columns([
                  // Custom columns...
              ]);
      }
      

Integration Tips

  • Existing Models: Use the "Generate Resource for Existing Model" option to scaffold a Filament resource around an existing Eloquent model.

  • Custom Fields: Register custom Filament fields in config/filament-architect.php under custom_fields:

    'custom_fields' => [
        'rich_editor' => \Filament\Forms\Components\RichEditor::class,
    ],
    
  • Testing: Use Pest/Livewire to test generated resources:

    use function Pest\Livewire\livewire;
    
    it('creates a record', function () {
        livewire(ListPosts::class)
            ->call('create', ['title' => 'Test', 'body' => 'Content'])
            ->assertSee('Test');
    });
    

Gotchas and Tips

Pitfalls

  1. Naming Conflicts:

    • Avoid reserved words (e.g., table, resource) for model/field names. The wizard validates these but may miss edge cases.
  2. Relationship Mismatches:

    • If generating a hasMany relationship, ensure the inverse belongsTo exists in the related model. Architect won’t auto-create it.
  3. API Resource Overrides:

    • Disabling API resources in config (generate_api_resource: false) won’t remove existing API routes. Manually delete them if needed.

Debugging

  • Wizard Stuck?: Clear Filament’s cache:

    php artisan filament:cache-reset
    

    Then retry the wizard.

  • Field Not Rendering: Check config/filament-architect.php for field mappings. Example:

    'field_mappings' => [
        'boolean' => 'toggle',
        'text'    => 'text_input',
    ],
    

Extension Points

  1. Custom Steps: Add a new step to the wizard by publishing the views:

    php artisan vendor:publish --tag="filament-architect-views"
    

    Then extend app/Views/vendor/filament-architect/steps/{step}.blade.php.

  2. Post-Generation Hooks: Use the generated event in EventServiceProvider:

    public function boot()
    {
        FilamentArchitect::generated(function (Resource $resource) {
            // Add custom logic (e.g., register policies)
        });
    }
    
  3. Field Presets: Define reusable field configurations in config/filament-architect.php:

    'field_presets' => [
        'user' => [
            'name' => ['type' => 'text', 'required' => true],
            'email' => ['type' => 'email', 'rules' => 'required|email'],
        ],
    ],
    

    Select presets during the wizard.

Pro Tips

  • Bulk Generation: Use the --batch flag in config to generate multiple resources at once (e.g., for all models in a namespace):

    'batch' => [
        'enabled' => true,
        'namespace' => 'App\Models',
    ],
    
  • Dark Mode: Architect respects Filament’s dark mode setting. Test in both themes post-generation.

  • Localization: Add translations for custom fields in resources/lang/{locale}/filament-architect.php:

    return [
        'fields' => [
            'rich_editor' => 'Rich Text Editor',
        ],
    ];
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle