Download the PHP package ikechukwukalu/makeservice without Composer
On this page you can find all versions of the php package ikechukwukalu/makeservice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ikechukwukalu/makeservice
More information about ikechukwukalu/makeservice
Files in ikechukwukalu/makeservice
Package makeservice
Short Description A laravel package for scaffolding service classes.
License MIT
Informations about the package makeservice
MAKE SERVICE
A laravel package for scaffolding Service, Traits, Enums, Facades, Actions, Repository and Interface classes.
REQUIREMENTS
- PHP 7.3+
- Laravel 8+
STEPS TO INSTALL
SERVICE CLASS
To generate a new service class.
To generate a new service class for a particular request class.
To generate a service class and a form request class together
TRAIT CLASS
To generate a new trait class.
ENUM CLASS
To generate a new enum class.
ACTION CLASS
To generate a new action class.
CONTRACT CLASS
To generate a new contract/interface class.
REPOSITORY CLASS
To generate a new repository class for a particular contract/interface class.
To generate extra fetch by user id methods.
To generate a repository class and a contract/interface class together
FACADE CLASS
To generate a new facade class.
To generate a facade class for a repository class
Bind the contract and the repository class
The last thing we need to do is bind UserRepository
to UserRepositoryInterface
in Laravel's Service Container. We will do this via a Service Provider. Create one using the following command:
Open app/Providers/RepositoryServiceProvider.php
and update the register function to match the following:
Finally, add the new Service Provider to the providers array in config/app.php
.
Bind the facade and the action class
If we have a User
facade class and a UserService
action class, we would need to add it to Laravel's Service Container. Facades for respository classes will work without any extra binding since they have already been added to the container within the RepositoryServiceProvider
class, but we would always need to register every facade class we created.
Create the provider:
Bind the action class:
Register the providers:
Finally, add the facade to the aliases array in config/app.php
.
LICENSE
The MS package is an open-sourced software licensed under the MIT license.
All versions of makeservice with dependencies
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
symfony/console Version ^5.4|^6.0|^7.0
php Version >=7.3