PHP code example of saritasa / laravel-entity-services

1. Go to this page and download the library: Download saritasa/laravel-entity-services 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/ */

    

saritasa / laravel-entity-services example snippets

    
 $entityServiceFactory = app(IEntityServiceFactory::class);  
 $entityService = $entityServiceFactory->build(User::class);
 

return [
 'bindings' => [\App\Models\User::class => \App\EntityServices\UserEntityService::class,],];

 $createdModel = $entityService->create($params); 
 
 $entityService->update($model, $params); 
 $entityService->delete($model); 

 $entityServiceFactory = app(IEntityServiceFactory::class);
 $entityService = $entityServiceFactory->register(User::class, YourServiceRealization::class);
 
 vendor/bin/phpcs
 vendor/bin/phpcbf
 vendor/bin/phpunit
bash  
php artisan vendor:publish --tag=laravel_entity_services