Download the PHP package kovacs-laci/laravel-skeletons without Composer
On this page you can find all versions of the php package kovacs-laci/laravel-skeletons. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kovacs-laci/laravel-skeletons
More information about kovacs-laci/laravel-skeletons
Files in kovacs-laci/laravel-skeletons
Package laravel-skeletons
Short Description An artisan command to make skeletons with content for a Laravel application.
License MIT
Informations about the package laravel-skeletons
laravel-skeletons
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. -
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/data
folder with the same name as the migration’s table name (e.g., if your migration creates ausers
table, 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: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.
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/lang
folder, preserving any subdirectory structure for different locales. - Customization Options:
Users can tailor the generation process with a variety of command-line options, such as:--with-bootstrap
: Generates views with Bootstrap styling.--purge
: Deletes all generated files for the specified migration.--cleanup
: Deletes all backup (.bak
) files.--no-copyright
: Omits the copyright header from generated PHP files.--api
: Generates API-specific controllers and routes, placing controllers in theapp/Http/Controllers/Api
directory and requiring the generated route file inroutes/api.php
. This option is ideal for building API backends.
By automating these repetitive tasks, intelligently discovering table relationships, managing data, route, and translation files seamlessly, and enforcing naming conventions, the app:make-skeletons
command 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.env
file to specify your preferred language by setting:These values tell the application which language files to load and use as fallbacks.
Paginator Setup:
-
Configuration:
In yourconfig/app.php
file, add a key for pagination (with a default value from the environment): -
.env Configuration:
Then, in your.env
file, define:This ensures that your paginated views will display the desired number of items per page.
Usage Instructions:
-
Installation:
Run the following Composer command to install the package as a development dependency: -
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:Note: The migration timestamp can be omitted.
Optional Flags:
--with-bootstrap
: Generates views with Bootstrap styling.--purge
: Deletes all generated files for the specified migration.--cleanup
: Deletes all backup (.bak
) files.--no-copyright
: Omits the copyright header from generated PHP files.--api
: Generates API-specific controllers (located in app/Http/Controllers/Api), requests, and routes (required in routes/api.php). This is useful for building backend APIs.
Final Note:
After following these steps, you’ll have your application’s language, pagination, and code scaffolding set up as intended.
Happy coding!