Download the PHP package tricioandrade/oneshot without Composer
On this page you can find all versions of the php package tricioandrade/oneshot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package oneshot
OneShot
Laravel artisan extra commands
"OneShot" is a development package in Laravel projects, particularly for APIs. It is a resource generator for items such as controllers, resources, requests, models, migrations, traits, and enums (PHP 8.1).
Installation
Open your terminal and run:
Generate your files
Create Enum files, your file will be created at app/Enum in yor Laravel project
Enum
Will create EmployeeFuncionsEnum.php file, like this:
EmployeeFunctionsEnum.php
Traits
The same for Traits files, your file will be created at app/Traits in your Laravel project.
Will create EmployeeFuncions.php file, like this:
EmployeeFunctions.php
Services
If you like to create services, you can also do do the same. But his template requires a model. Like this example:
Will create EmployeeFunctionsService.php file, like this:
app/Services/EmployeeFunctionsService.php
The imported class:
Importing the model EmployeeFunctionsServiceModel and other classes is optional, it will not exist after creating the service. You can adapt the code however you want. Setup his template as you wish at:
stubs\create.service.stub### Resources for APIs
For resources, this is a bit weird:
Will create some resources files like:
#### 1. Controller ###### Oneshot customized controller file:app/Http/Controllers/User/EmployeeController.php#### 2. Request ###### Default laravel request file:
app/Http/Requests/User/EmployeeRequest.php#### 3. Resource ###### Default laravel resource file:
app/Http/Resource/User/EmployeeResource.php#### 4. Model ###### Default laravel Model object and his migration at database/migrations folder:
app/Models/User/EmployeeModel.php
For those who like to save time, how about this last feature in this package?
You can see how the generated controller looks like:
## NewCrudTrai.php added