Skip to content

laravel-enso/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

297 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cli

License Stable Downloads PHP Issues Merge Requests

Description

Cli is the interactive scaffolding tool for Laravel Enso resources and packages.

The package exposes the enso:cli command, keeps a restorable configuration session in cache, validates the configured model and menu structure before generation, and writes the backend, frontend, and package boilerplate needed for standard Enso CRUD modules.

It is intended to accelerate repetitive Enso structure work, not to replace manual refinement after the initial scaffold is created.

Installation

Install the package:

composer require laravel-enso/cli

If you want to publish the configuration presets used by the generator:

php artisan vendor:publish --tag=cli-config

The package automatically:

  • registers the enso:cli Artisan command
  • merges the structure presets from config/enso/structures
  • writes generated files into either the application tree or a new Enso package tree, depending on the selected options

Features

  • Interactive command flow for configuring model, permission group, permissions, menu, files, and package metadata.
  • Validation for namespaced model paths, menu routing consistency, and parent-menu selection before generation.
  • Cached session restore so incomplete scaffolding sessions can be resumed.
  • Writers for models, migrations, form builders and templates, table builders and templates, CRUD routes, Vue pages, and structure migrations.
  • Package scaffolding support, including resources, optional config, and optional service providers.

Usage

Start the interactive generator:

php artisan enso:cli

The command lets you configure these sections before generation:

  • Model
  • Permission Group
  • Permissions
  • Menu
  • Files
  • Package

When generation succeeds, the package clears the cached session and, when needed, prints the API route include that must be added to the host application's routes/api.php.

Validation can be toggled off temporarily from the command menu, but the intended workflow is to keep it enabled and fix the reported configuration errors before generating files.

API

Artisan command

  • enso:cli

Published configuration

Published under config/enso/structures:

  • model.php
  • menu.php
  • permissions.php
  • package.php
  • params.php
  • files.php
  • permissionGroup.php

Generated artifacts

Depending on the selected file set, the generator can write:

  • Eloquent model classes
  • create-table and structure migrations
  • form builders, templates, and request validators
  • table builders and templates
  • CRUD API controllers and route stubs
  • frontend view pages and route files
  • package resources, config, and providers

Validation rules

Built-in validation covers:

  • namespaced model syntax using forward slashes
  • menu route alignment with permission routes
  • regular menu items requiring a route
  • parent menu existence and ambiguity checks
  • parent-menu route restrictions when has_children is enabled

Depends On

Required Enso packages:

Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

Packages

 
 
 

Contributors

Languages