Download the PHP package asif160627/laravel-resources-generator without Composer
On this page you can find all versions of the php package asif160627/laravel-resources-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download asif160627/laravel-resources-generator
More information about asif160627/laravel-resources-generator
Files in asif160627/laravel-resources-generator
Package laravel-resources-generator
Short Description Generate Laravel Model,Migration,Service,Controller,Resources with single command
License MIT
Homepage https://github.com/md-asifiqbal/laravel-generate-resources
Informations about the package laravel-resources-generator
Laravel Generate Resources
Generate Laravel Model, Migration, Service, Controller, Resources with a single command.
Installation
You can install this package via Composer:
Usage
After installing the package, you can use the generate:resource command to generate the necessary files for a resource:
Replace {name} with the desired name of your resource. This command will generate a model, migration, service, controller, resource, and other related files.
Replace {name} with the desired name for your resource. The command will create the following files associated with the specified resource:
The generate:resource
command creates the following files for a new resource:
- A model with the specified name.
- A migration file for the model's database table.
- A service class for managing the resource's business logic.
- A controller for handling HTTP requests and responses.
- A resource class for formatting the resource's data in API responses.
- A request class for validating input data.
Publishing Resources
This package supports resource publishing, allowing you to customize the generated files to fit your project's needs. To publish the package's resources, you can use the following command:
This command will list the available resources for publishing. You can choose which resources you want to publish by selecting the associated numbers.
Example
For instance, if you want to generate the necessary files for a resource named "Product," you would execute the following command:
Subfolders
If you want to organize the generated files within a specific subfolder, you can specify the subfolder along with the resource name. For example, to create a Product resource within an Admin subfolder, use the following command:
The command will create the necessary files for the Product resource within the Admin subfolder.
Customizing Generated Files
The generate:resource command streamlines the process of generating common resource files. However, you can always modify and extend these files further to match your project's specific requirements.
Testing
To run the package tests, execute the following command:
This will run the tests for the generate:resource command and ensure its functionality.
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
License
This package is open-source software licensed under the MIT license.