PHP code example of inmanturbo / modelware

1. Go to this page and download the library: Download inmanturbo/modelware 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/ */

    

inmanturbo / modelware example snippets


use Inmanturbo\Modelware\Facades\Modelware;

Modelware::add('eloquent.updating*', [
    EnsureModelShouldBeSaved::class,
    ValidateAttributes::class,
    FillModel::class,
], prefix: 'modelware'); // modelware is the default

    app()->bind("{$prefix}.{$event}", function () use ($pipes) {
        return collect($pipes)->map(fn ($pipe) => app($pipe));
    });

$data = app(Data::class, [
    'event' => $events,
    'model' => $payload[0],
    'payload' => $payload,
]);