dejwcake / admin-generator
Laravel CRUD generator for dejwcake/craftable
Requires
- php: ^8.5
- illuminate/console: ^13.0
- illuminate/support: ^13.0
Requires (Dev)
- larastan/larastan: ^3.9
- orchestra/testbench: ^11.1
- phpunit/phpunit: ^13.1
- spatie/phpunit-snapshot-assertions: ^5.3
README
Admin Generator is a Laravel package that quickly scaffolds full CRUD administration for your existing, migrated database tables. It generates controllers, form requests, models, views, routes, and translations so you can get a production-ready admin interface in minutes instead of wiring everything by hand.
It builds on the admin UI template from our dejwCake/admin-ui package and is shipped as part of the Craftable ecosystem, making it a good fit for new and existing Craftable-based projects.
Example of an administration interface generated with this package:
This package is part of Craftable (dejwCake/craftable), an administration starter kit for Laravel 12, forked from Craftable (brackets/craftable).
Documentation
You can find full documentation at https://docs.getcraftable.com/#/admin-generator
Issues
Where do I report issues? If something is not working as expected, please open an issue in the main repository https://github.com/dejwCake/craftable.
How to develop this project
Composer
Update dependencies:
docker compose run -it --rm test composer update
Composer normalization:
docker compose run -it --rm php-qa composer normalize
Run code analysis tools (php-qa)
PHP compatibility:
docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache
Code style:
docker compose run -it --rm php-qa phpcs -s --colors --extensions=php
Fix style issues:
docker compose run -it --rm php-qa phpcbf -s --colors --extensions=php
Static analysis (phpstan):
docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon
Mess detector (phpmd):
docker compose run -it --rm php-qa phpmd ./src,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml
Run tests
Run tests against mariadb:
docker compose run -it --rm -e DB_CONNECTION=mysql test ./vendor/bin/phpunit
Run tests against postgresql:
docker compose run -it --rm -e DB_CONNECTION=pgsql test ./vendor/bin/phpunit
Run tests with coverage:
docker compose run -it --rm test ./vendor/bin/phpunit --coverage-text
To regenerate snapshots use:
docker compose run -it --rm -e UPDATE_SNAPSHOTS=true test ./vendor/bin/phpunit
Run the whole PHP suite
Run every PHP check and the test suite against both databases in sequence (stops at the first failure):
docker compose run -it --rm test composer update \ && docker compose run -it --rm php-qa composer normalize \ && docker compose run -it --rm php-qa phpcs --standard=.phpcs.compatibility.xml --cache=.phpcs.cache \ && docker compose run -it --rm php-qa phpcs -s --colors --extensions=php \ && docker compose run -it --rm php-qa phpstan analyse --configuration=phpstan.neon \ && docker compose run -it --rm php-qa phpmd ./src,./tests ansi phpmd.xml --suffixes php --baseline-file phpmd.baseline.xml \ && docker compose run -it --rm -e DB_CONNECTION=mysql test ./vendor/bin/phpunit \ && docker compose run -it --rm -e DB_CONNECTION=pgsql test ./vendor/bin/phpunit