Download the PHP package tharindu/facade_generator without Composer
On this page you can find all versions of the php package tharindu/facade_generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tharindu/facade_generator
More information about tharindu/facade_generator
Files in tharindu/facade_generator
Package facade_generator
Short Description A Laravel package to generate facades and services.
License MIT
Informations about the package facade_generator
Laravel Domain Generator
Laravel Domain Generator is a package that provides a convenient way to generate domain services and facades in your Laravel application.
Installation
You can install the package via Composer:
Usage
To generate a domain service and facade, use the make:domain
Artisan command:
This command will create the following files in the domain
directory:
ServiceNameFacade.php
ServiceNameService.php
You can then use these files to implement your domain logic.
Autoloading the Domain Directory
To ensure Laravel autoloads your custom domain
directory, you need to update the composer.json
file of your Laravel application. Follow these steps:
-
Open your Laravel application's
composer.json
file. -
Locate the
autoload
section. It should look something like this: -
Add your
domain
directory to the PSR-4 autoloading section. If your domain directory is located at the root of your Laravel application, you can add it like this:Make sure to adjust the path
"Domain\\"
and"domain/"
according to the actual structure of your application. - Run
composer dump-autoload
to regenerate the Composer autoloader files:
Once you've made these changes, Laravel will autoload classes from your domain
directory just like it does with the app
directory, making your domain logic easily accessible throughout your application.
Functionalities
The package provides the following functionalities:
- Generation of Domain Service and Facade: Easily create domain services and facades using the
make:domain
command. - CRUD Functionality: The generated service stubs include basic CRUD operations for managing domain entities.
- Create: Create new domain entities.
- Read: Retrieve specific domain entities.
- Update: Update existing domain entities.
- Delete: Delete domain entities.
- List: Retrieve a list of domain entities.
Examples
Generating a Domain
To generate a domain service and facade named User
, run:
This will create UserFacade.php
and UserService.php
in the domain
directory.
Using the Generated Files
Once the files are generated, you can implement your domain logic inside the service methods. For example:
Contributing
Contributions are welcome! Please feel free to submit a pull request.
License
The Laravel Domain Generator is open-sourced software licensed under the MIT license.
All versions of facade_generator with dependencies
illuminate/support Version ^10.0|^11.0
phpunit/phpunit Version ^9.0|^10.0|^11.0