Skip to main content

Helpers

super-admin-org/helpers is a set of developer tools inside the admin panel:

  • Scaffold: a form that generates a migration, model, admin controller, API controller, Blade CRUD views, routes, a menu item and Pest tests for a table.
  • Database terminal: run SQL (or Redis commands) against any configured connection.
  • Laravel artisan: run Artisan commands from the browser.
  • Routes: a searchable list of every registered route.

Scaffold list

Packagesuper-admin-org/helpers
Admin URLs/admin/helpers/scaffold, /admin/helpers/terminal/database, /admin/helpers/terminal/artisan, /admin/helpers/routes
MenuHelpers with four children
Permissionext.helpers (path /helpers/*)
Tableshelper_scaffolds, helper_scaffold_details
Local development only

The terminals run any SQL statement and any Artisan command, and the scaffold writes PHP files into your application and can drop tables. Install Helpers as a dev dependency (composer require --dev) or disable it outside local development:

// config/admin.php
'extensions' => [
'helpers' => ['enable' => env('APP_ENV') === 'local'],
],

Installation​

composer require --dev super-admin-org/helpers
php artisan migrate # creates helper_scaffolds and helper_scaffold_details
php artisan admin:import helpers # adds the Helpers menu and the ext.helpers permission

Scaffold​

Open Helpers > Scaffold and click Create New.

Scaffold form

  1. Table name, Model (App\Models\...) and Controller (App\Admin\Controllers\...).

  2. Tick what to generate:

    OptionGenerates
    Migrationdatabase/migrations/<date>_create_<table>_table.php
    Modelthe Eloquent model, with fillable fields, casts and relations for select fields
    Controllera Super Admin controller (grid, form, show)
    Migrateruns php artisan migrate right away
    Recreate tabledrops the table first if it exists (data is lost)
    Apian API controller, the ResponseMapper trait and routes/api.php entries
    Blade cruda public Blade CRUD (controller, _layout, index, _form, create, edit, show)
    Test casePest feature and unit tests
  3. Add fields with Add field: name, type, nullable, key (index/unique), default, comment, and the input type used in the form (text, email, date, select, radio, checkbox, file, textarea, ...). For choice inputs, Source for options is either static with comma-separated values and labels, or a model class with the value and label columns.

  4. Choose Timestamps, Soft Deletes, the Primary key name and UUID keys.

  5. Click Submit. The page lists every file it wrote. An admin resource route and a menu item are added for the new controller.

Saved scaffolds stay in the list. Edit reopens one and regenerates its files; Delete removes the record and the files it generated.

Console commands​

CommandDoes
php artisan scaffold:generate-from-mysql-tables {--remove-prefix=}Creates scaffold records from existing MySQL tables
php artisan scaffold:generate-from-pgThe same for PostgreSQL
php artisan scaffold:generate-code {--table=}Regenerates the code of every saved scaffold (or one table)
php artisan scaffold:generate-seeders {--remove-prefix=}Writes seeders from the data in existing tables

Database terminal​

Database terminal

Pick a connection (top right), type a query and press Enter. Results show as a text table with the row count and time; end the query with \G for a vertical dump. Redis connections accept Redis commands.

The terminal executes whatever you type, including UPDATE, DELETE and DROP.

Laravel artisan​

Artisan terminal

Type a command without the php artisan prefix (for example route:list --path=admin) or pick one from the grouped buttons. Interactive commands (tinker, prompts) and long-running ones (serve, queue:work) do not work here.

Routes​

Route list

Every registered route with its methods, URI (parameters highlighted), name, action and middleware. Filter by method or URI.

Compatibility​

LaravelPHPState
8 – 138.0+Scaffold, Artisan terminal and route list work.

Known limitations:

  • The Redis part of the database terminal needs the predis client (REDIS_CLIENT=predis); with phpredis it fails.
  • The MongoDB option uses the eval command, which MongoDB removed in 4.2.
  • scaffold:generate-from-mysql-tables is MySQL/MariaDB only; use scaffold:generate-from-pg for PostgreSQL. SQLite and SQL Server have no import command.
  • Submitting the scaffold form with no option ticked fails; tick at least one.

Troubleshooting​

ProblemFix
The new menu item gives 404The admin route was added to app/Admin/routes.php; run php artisan route:clear.
"Migration skipped: table already exists"Tick Recreate table (drops the data) or create a new migration by hand.
Generated files were not writtenThe web server user needs write access to app/, database/, resources/views/, routes/ and tests/.