kovacs-laci / laravel-skeletons
An artisan command to make skeletons with ready from box content for a Laravel application.
Requires
- php: >=8.0
Requires (Dev)
- illuminate/console: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
Suggests
- illuminate/console: Required for command-line features
- illuminate/support: Provides helper functions
- dev-master
- 1.1.22
- 1.1.21
- 1.1.20
- 1.1.19
- 1.1.18
- 1.1.17
- 1.1.16
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0.5
- 1.0.0.4
- 1.0.0.3
- 1.0.0.2
- 1.0.0.1
- 1.0.0.0
- dev-develop
- dev-my-skeletons
This package is auto-updated.
Last update: 2026-03-01 19:01:32 UTC
README
Laravel Skeletons Generator Command
Repository: https://github.com/Amice/laravel-skeletons.git
The app:make-skeletons command is a comprehensive migration-driven code-generation tool for Laravel applications. It automates the creation of your app’s core scaffolding with the following key features:
-
Migration Parsing and Related Entities Discovery:
The command reads a specified migration file to extract the table name, column definitions, and relationships. It automatically detects foreign key relationships and recursively examines related migrations. This means it generates all necessary files (models, controllers, views, seeders, etc.) for your main table as well as for any related tables, ensuring complete scaffolding for your database schema. It recognizes the following types of foreign key definitions in migration files: -
foreignId()$table->foreignId('vehicle_id')->constrained('vehicles')->onDelete('cascade');
-
foreign()$table->unsignedBigInteger('vehicle_id'); $table->foreign('vehicle_id')->references('id')->on('vehicles')->onDelete('cascade');
-
File Generation:
Based on the parsed migration data, the command automatically generates:-
Models: Complete with fillable attributes, relationships, and configuration (such as timestamp settings).
-
Controllers: Ready-to-use controllers with stubs tailored for your chosen CSS framework (Bootstrap or Tailwind).
-
Requests: Fields marked as non-nullable in your migration are automatically assigned the required validation rule when creating or updating records. Additionally, corresponding language files containing validation messages prefixed with
validate_are generated to facilitate multi-language support. -
Views: CRUD views that integrate with your layout and support multilingual setups. If auth middleware is detected Views for data-modifying operations are automatically secured, only authenticated users will have access.
-
Seeders:
Bulk import logic that dynamically adjusts for performance with large datasets and includes progress feedback.
Note: Data source CSV files should be placed in theseeders/datafolder with the same name as the migration’s table name (e.g., if your migration creates auserstable, the corresponding CSV file should be namedusers.csv). -
Routes:
A separate route file is generated for each table, with the file name derived from the table name. These route files contain common CRUD route definitions, for example:Route::post('/examples', [ExampleController::class, 'store'])->name('examples.store'); Route::get('/examples/create', [ExampleController::class, 'create'])->name('examples.create'); Route::patch('/examples/{example}', [ExampleController::class, 'update'])->name('examples.update'); Route::get('/examples/{example}/edit', [ExampleController::class, 'edit'])->name('examples.edit'); Route::delete('/examples/{example}', [ExampleController::class, 'destroy'])->name('examples.destroy'); Route::get('/examples', [ExampleController::class, 'index'])->name('examples.index'); Route::get('/examples/{example}', [ExampleController::class, 'show'])->name('examples.show'); Route::post('/examples/search', [ExampleController::class, 'search'])->name('examples.search');
Additionally, if authentication middleware is available in your application, the generated routes for data-modifying operations (store, update, destroy, etc.) are automatically wrapped with it to ensure secure access.
// Routes not requiring authentication Route::get('/examples', [ExampleController::class, 'index'])->name('examples.index'); Route::post('/examples/search', [ExampleController::class, 'search'])->name('examples.search'); // Routes requiring authentication Route::middleware('auth')->group(function () { Route::post('/{{ table_name }}', [{{ controller }}::class, 'store'])->name('{{ table_name }}.store'); Route::post('/examples', [ExampleController::class, 'store'])->name('examples.store'); Route::get('/examples/create', [ExampleController::class, 'create'])->name('examples.create'); Route::patch('/examples/{example}', [ExampleController::class, 'update'])->name('examples.update'); Route::get('/examples/{example}/edit', [ExampleController::class, 'edit'])->name('examples.edit'); Route::delete('/examples/{example}', [ExampleController::class, 'destroy'])->name('examples.destroy'); }); Route::get('/examples/{example}', [ExampleController::class, 'show'])->name('examples.show');
-
All generated route files are automatically required in your main web.php / api.php file, so your routes are seamlessly integrated into the application.
-
Language Files Generation and Copy:
The command generates a separate language file for each model. The file name is derived directly from the table name. These generated language files are then copied recursively into your project’sresources/langfolder, preserving any subdirectory structure for different locales. -
Customization Options: By automating these repetitive tasks, intelligently discovering table relationships, managing data, route, and translation files seamlessly, and enforcing naming conventions, the
app:make-skeletonscommand can significantly speed up your development process—allowing you to focus on building application-specific features rather than boilerplate code.
Important: As the tool is built for the Laravel ecosystem, it expects table names to be in English plural form. Not adhering to this rule might lead to unexpected results in file naming and translation management.
Overview
Language Settings:
- Environment Variables:
Update your.envfile to specify your preferred language by setting:
These values tell the application which language files to load and use as fallbacks. The language files can be found in corresponding subfolder ofAPP_LOCALE=en APP_FALLBACK_LOCALE=enresources\langfolder.
Paginator Setup:
- Configuration:
In yourconfig/app.phpfile, add a key for pagination (with a default value from the environment):'pagination_limit' => env('APP_PAGINATION_LIMIT', 20),
- .env Configuration:
Then, in your.envfile, define:
This ensures that your paginated views will display the desired number of items per page.APP_PAGINATION_LIMIT=20
Usage Instructions:
-
Installation:
Run the following Composer command to install the package as a development dependency:composer require --dev kovacs-laci/laravel-skeletons -
Generating Files:
To generate the scaffolding, run the artisan command with the appropriate options. For example, if your migration file creates a table calledexamples, execute:php artisan app:make-skeletons --migration=create_examples_tableNote: The migration timestamp can be omitted.
Optional Flags: Users can tailor the generation process with a variety of command-line options, such as:
--migration[=MIGRATION]: The migration file to be used, e.g. create_products_table.--api: Generates code for REST API.--css-style[=CSS-STYLE]: The CSS style to apply. Available options: plain, bootstrap, tailwind [default: "plain"]--with-auth: Include authentication support in the generated code.--no-copyright: If set, generated files will omit the copyright header.--cleanup: Remove all .bak files from the folders and exit.--purge: Remove all generated files for given migration.
A log file is saved to
storage\logs\skeletonsfolder when the file-generation process has finished. This file is used with--purgeoption.
Final Note:
After following these steps, you’ll have your application’s language, pagination, and code scaffolding set up as intended.
Happy coding!