glugox / magic
Tools for creating magic!
Fund package maintenance!
glugox
Requires
- php: ^8.4
- glugox/ai: ^1.0.0
- illuminate/contracts: ^10.0||^11.0||^12.0
- prism-php/prism: ^0.86.0
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^2.0||^3.0
- pestphp/pest-plugin-arch: ^2.5||^3.0
- pestphp/pest-plugin-laravel: ^2.0||^3.0
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
- spatie/laravel-ray: ^1.35
README
Magic is a lightweight PHP/Laravel toolkit that auto-generates application files from entity configurations stored in JSON files.
It streamlines tasks like database migrations, seeding, and realistic data generation with Faker β making it ideal for testing, prototyping, and automation.
With Magic, you can build full-featured Laravel applications directly from configuration files, eliminating repetitive boilerplate and speeding up development.
π§ How it works
π Quick Start
-
Create a new Laravel project (if you donβt have one yet):
laravel new my-magic-app
When prompted:
- Choose Vue starter.
- Choose Laravelβs built-in authentication.
- Choose Pest for testing.
- Allow Laravel to install the required packages.
-
Navigate into your project:
cd my-magic-app
-
Install Magic via Composer:
composer require glugox/magic --dev
-
Publish the configuration file:
php artisan vendor:publish --provider="Glugox\Magic\MagicServiceProvider"
-
Explore demo samples (JSON config files in
stubs/samples
):php artisan magic:list-samples
-
Build your app using a starter:
php artisan magic:build --starter=inventory
-
Or use your own config file:
php artisan magic:build --config=path/to/your/config.json
π See the sample configurations directory for examples.
-
Run the app:
npm run dev php artisan serve
β¨ Features
- Entity Management β Define entities with fields, relations, casts.
- CRUD Generation β Auto-generate CRUD for every entity.
- Migrations β Create DB migrations from your definitions.
- Seeding β Seed sample or Faker-based data.
- Config-Driven β JSON-powered structure & behavior.
- Extensible β Override stubs, extend generators.
- Laravel Native β Fully integrated into Laravel workflow.
- Development Mode β Quickly spin up test data.
- Search & Sort β Mark fields as searchable/sortable.
- Hidden Fields β Exclude fields from forms/views.
- Casts β Ensure correct field data types.
- Relations β Define
hasMany
,belongsTo
, etc.
π¦ Starter Kits
Use predefined configurations to bootstrap your app:
- Task Management
- E-commerce
- Education
- Resume Builder
How to use:
-
Pick a starter from the samples directory (use file name as starter name).
-
Run:
php artisan magic:build --starter=task
π€ Contributing / Contact
Got ideas or feedback?
Reach out via email.
π License
The MIT License (MIT). See LICENSE for details.
composer require glugox/magic:@dev --prefer-source --repository='{"type":"path","url":"/Users/ervin/Code/github.com/glugox/magic"}'