PHP code example of sergeybruhin / laravel-service

1. Go to this page and download the library: Download sergeybruhin/laravel-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sergeybruhin / laravel-service example snippets

bash
php artisan service:create Delivery
text
app/Services/Delivery/
  Actions/
  Commands/
  Data/
  Dto/
  Events/
  Exceptions/
  Facade/
    DeliveryService.php
  Handlers/
  Interfaces/
    DeliveryServiceContract.php
  Jobs/
  Listeners/
  Providers/
    EventServiceProvider.php
    ServiceProvider.php
  DeliveryService.php
bash
php artisan make:service Delivery
php artisan create:service Delivery
bash
php artisan service:create Delivery --full
text
Actions/DefaultAction.php
Handlers/DefaultHandler.php
Events/DefaultEvent.php
Events/DefaultBroadcastEvent.php
Listeners/DefaultListener.php
Jobs/DefaultJob.php
Commands/DefaultCommand.php
Exceptions/DeliveryException.php
Data/DefaultData.php
Dto/DefaultDto.php
bash
php artisan service:action Delivery CreateShipmentAction
php artisan service:handler Delivery SyncShipmentsHandler
php artisan service:job Delivery SyncShipmentsJob
php artisan service:event Delivery ShipmentCreatedEvent
php artisan service:event Delivery ShipmentUpdatedEvent --broadcast
php artisan service:broadcast-event Delivery ShipmentStatusChangedEvent
php artisan service:listener Delivery SendShipmentNotificationListener
php artisan service:command Delivery SyncShipmentsCommand