Download the PHP package glugox/magic without Composer

On this page you can find all versions of the php package glugox/magic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package magic

logo.svg Magic

PHP Version Coverage

A Laravel code generator that turns JSON entity definitions into a working application or a reusable Composer package. Magic wires migrations, models, controllers, Vue/Inertia pages, tests, and boilerplate Laravel setup so you can prototype or bootstrap production features in minutes.


Table of contents

  1. What Magic does
  2. Requirements
  3. Installation
  4. Running the generator
  5. Understanding configuration
  6. Package mode
  7. File generation reference
  8. Resetting a build
  9. Customising stubs & namespaces
  10. Testing and quality tools
  11. Troubleshooting
  12. Contributing
  13. License

What Magic does

Magic reads a JSON schema that describes your domain (entities, relations, presets, UI metadata) and executes a predictable build pipeline:

  1. Resolve configuration and normalise paths.
  2. Publish starter assets and language files.
  3. Install the required Composer and NPM dependencies (host builds only).
  4. Generate migrations, models, enums, factories, seeders, REST controllers, form requests, API resources, TypeScript definitions, Vue pages, and Pest tests.
  5. Register routes, Sanctum middleware, queues, and Inertia bootstrapping when targeting a Laravel application.
  6. Produce a manifest of generated files so resets can be executed safely.

Every build step is implemented as a dedicated action under src/Actions/Build, making the pipeline easy to extend or re-order for your own needs.


Requirements

Requirement Version
PHP ^8.4
Laravel 10.x – 12.x
Node.js & npm Required for front-end scaffolding
Composer Latest stable

Tip: Magic ships as a regular Laravel package. You can install it globally in a host Laravel app or use package mode to generate a standalone Composer package that you pull into multiple projects.


Installation

Install into a Laravel application

  1. Create or open a Laravel application that already has Breeze/Inertia (Vue) installed.
  2. Require Magic as a dev dependency:

  3. Publish the configuration file:

  4. Optional: explore the sample configurations in stubs/samples.

Install for package generation

If you plan to generate re-usable features as a package, install Magic in a throwaway Laravel project and run the generator with the package flags (described below). Magic will emit a new Composer package that you can require in your real application.


Running the generator

Magic exposes one primary Artisan command:

Option Description
--config= Absolute or relative path to a JSON configuration file.
--starter= Name of a starter config shipped with Magic (e.g. inventory, task).
--set= Inline overrides using dot notation (--set=app.name="Acme"). Repeatable.
--package-path= Destination directory for Composer package builds. Creates the folder if missing.
--package-namespace= Root PSR-4 namespace to use when generating a package (e.g. Acme\Inventory).
--package-name= Composer package name for package builds (e.g. acme/inventory-kit).

Examples:

Magic prevents accidental overwrites by checking for storage/magic/generated_files.json. Run php artisan magic:reset (see below) before triggering a new build in the same environment.


Understanding configuration

A minimal entity definition:

When a build runs, the configuration is parsed into strongly typed objects (src/Support/Config) so generators can reason about default values and relationships safely.


Package mode

Package mode rewires Magic so that every generated file lands inside a Composer package instead of your Laravel app. Three options must be provided: --package-path, --package-namespace, and --package-name.

Key behaviours:

After running the generator in package mode:

  1. Commit the generated package to its own repository (or keep it inside a monorepo under packages/).
  2. Require it from your real Laravel application via VCS or path repositories.
  3. Register the generated service provider if you disable Laravel’s automatic package discovery.

Example of generating a package called glugox/module-a with the orchestrator starter:


File generation reference

Area What gets generated
Database Timestamped migrations, model factories, individual seeders.
Domain Eloquent models, relationships, query scopes, enums, Meta classes, console commands for entity actions.
HTTP layer API controllers, form requests, API resources, routes (routes/app.php, routes/app/api.php) and attachable asset support.
Front-end Vue 3 pages (index, create, edit, detail), shared components, TypeScript DTOs, lucide icon imports, composables.
Testing Pest feature tests for CRUD operations, HTTP tests, and package-specific coverage.
DevOps Magic manifest under storage/magic, queue installation helpers, .env updates (host builds only).

Refer to the corresponding action classes in src/Actions/Build for implementation details.


Resetting a build

Use the reset command when you need to revert the generated artefacts inside a Laravel application:

magic:reset replays the manifest from storage/magic/generated_files.json, deletes migrations, models, seeders, controllers, Vue pages, TypeScript artefacts, and restores modified Laravel files to their original state before optionally refreshing the database. Package builds can be reset manually by deleting the destination directory and re-running magic:build.


Customising stubs & namespaces


Testing and quality tools

The project uses Pest, PHPStan, Laravel Pint, and Rector. Run everything locally with:

When contributing, make sure your feature and unit tests cover new behaviour—especially when altering generators or stubs.


Troubleshooting


Contributing

Issues and pull requests are welcome! If you are planning a large change, please open an issue first so we can discuss scope and direction. When submitting a PR:

  1. Add or update tests.
  2. Run the QA commands listed above.
  3. Document user-facing changes in this README or the changelog.

You can also reach out directly at [email protected].


License

Magic is open-sourced software licensed under the MIT license.


All versions of magic with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
glugox/ai Version *
glugox/model-meta Version *
glugox/table-query Version *
illuminate/contracts Version ^10.0||^11.0||^12.0
prism-php/prism Version ^0.86.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package glugox/magic contains the following files

Loading the files please wait ...