Frequently Asked Questions

Find answers to common questions about Larahammer Generator.

What versions of Laravel does Larahammer support?

Larahammer supports Laravel 10, 11, 12, and 13. It requires PHP 8.1 or higher.

Can I use Larahammer with an existing project?

Yes! Larahammer can be added to any existing Laravel project. You can start scaffolding new features whenever you need them.

Do I need to install Filament to use Larahammer?

No, Filament is optional. If you don't use the --target=filament or --with-admin flags, Filament is not required. However, if you want those features, Filament v3 must be installed in your project.

What happens if I generate the same model twice?

By default, Larahammer will ask for confirmation before overwriting existing files. Use --force flag to overwrite without asking: php artisan larahammer:make Product --force

Can I customize the generated stubs?

Yes! Publish the stubs directory and customize them: php artisan vendor:publish --provider='Larahammer\Generator\GeneratorServiceProvider' --tag=stubs

What field types are supported?

All Laravel migration field types are supported: string, text, integer, boolean, date, datetime, decimal, enum, json, longText, mediumText, uuid, smallIncrements, bigInteger, etc.

Does --all generate everything at once?

Yes! The --all flag generates all 3 targets (Blade, Filament, API) plus all 12 advanced features (roles, landing, admin, security middleware, factories, soft deletes, policies, API auth, tests, audit logging, etc.)

How do I set a default target?

Publish the config file and set default_target: php artisan vendor:publish --provider='Larahammer\Generator\GeneratorServiceProvider' --tag=config

Can I mix Blade and Filament in the same project?

Yes! Use --target=all to generate both. They work seamlessly together in the same project.

What testing framework does Larahammer use?

Larahammer generates tests using Laravel's PHPUnit testing framework (Pest is also compatible).

Troubleshooting

"Namespace not found" error

Make sure to run composer install and check that the package is properly registered.

bash
composer install && php artisan list

Migration not found after generation

Make sure you ran the migration and check the database/migrations folder:

bash
php artisan migrate && php artisan migrate:status

Views not showing after generation

Check that routes are properly registered and the app.blade.php layout exists:

bash
php artisan route:list | grep -i product

Filament resource not appearing

Make sure Filament is installed and the resource is registered in your AdminPanelProvider:

bash
composer require filament/filament

API routes returning 404

Check that API routes are properly registered in routes/api.php and middleware is applied:

bash
php artisan route:list --path=api

Tests failing after generation

Ensure your database is set up for testing and migrations run:

bash
php artisan test

Performance

How long does generation take?

Generation typically takes less than 1 second. The --all flag generates 80+ files but still completes in under 2 seconds.

Will generated code impact performance?

No. Generated code follows Laravel best practices and has zero performance impact. Generated models use appropriate indexes in migrations.

Can I regenerate a model?

Yes. Use --force to overwrite existing code. It's safe to regenerate — existing data won't be affected. Just re-run migrations if the schema changed.

Getting Help

GitHub Issues

Found a bug? Report it on GitHub.

Report an Issue →

Documentation

Check out our comprehensive docs.

API Reference →

Source Code

Explore the package source.

View on GitHub →

Packagist

Install and version history.

View on Packagist →

Ready to start?

Check out the Getting Started guide to scaffold your first project.