kennethsolomon / make-service
Can run 'php artisan make:service Foobar' to create new Services.
v1.1.2
2023-01-04 01:15 UTC
This package is auto-updated.
Last update: 2025-01-04 06:06:57 UTC
README
Type composer require kennethsolomon/make-service --dev
How to use
Just type php artisan make:service FoobarService
Inside Controller you can use
- Import FoobarService in your controller ->
use App\Services\FoobarService;
$FoobarService = FoobarService::getInstance();
$FoobarService->foo()
# Asumming that there has foo() method inside your service
or
protected $FoobarService; public function __construct(FoobarService $FoobarService) { $this->FoobarService = $FoobarService; }
$this->FoobarService->bar()
# Assuming that there has bar() method inside your service