Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lozemc/laravel-services
Simple command to create Service class in Laravel
https://github.com/lozemc/laravel-services
command commands laravel service services
Last synced: 10 days ago
JSON representation
Simple command to create Service class in Laravel
- Host: GitHub
- URL: https://github.com/lozemc/laravel-services
- Owner: lozemc
- License: mit
- Created: 2024-02-25T19:18:16.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-21T17:31:18.000Z (9 months ago)
- Last Synced: 2024-07-25T21:17:46.084Z (6 months ago)
- Topics: command, commands, laravel, service, services
- Language: PHP
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel Service Command
## Installation
To get started with Laravel Service Command, simply require the package
via [Composer](https://packagist.org/packages/lozemc/laravel-services):```bash
composer require lozemc/laravel-services
```
### Installation for Laravel 10.xNext, add the following line to the $commands array in your `/app/Console/Kernel.php` file:
```php
protected $commands = [
// ...\App\Console\Commands\ServiceMakeCommand::class,
];
```If the protected $commands array does not exist, you will need to add it.
### Installation for Laravel 11.xThen add the following line to the returned array in `/bootstrap/providers.php`:
```php
return [// ...
Lozemc\Services\Providers\MakeServiceProvider::class,
];
```## Usage
Once installed and configured, you can use the artisan command to create a new service:
```bash
php artisan make:service PostService
```This will generate a new service class named `PostService` in the `App\Services` namespace. You can then implement
your business logic within this service class.### Other
- [Laravel Action Command](https://github.com/lozemc/laravel-actions)