imanghafoori1/laravel-heyman

View on GitHub
src/Plugins/WatchingStrategies/EloquentModels/EloquentSituations.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Imanghafoori\HeyMan\Plugins\WatchingStrategies\EloquentModels;

final class EloquentSituations
{
    protected $methods = [
        'whenYouFetch' => 'retrieved',
        'whenYouCreate' => 'creating',
        'whenYouUpdate' => 'updating',
        'whenYouSave' => 'saving',
        'whenYouDelete' => 'deleting',
    ];

    /**
     * @param  $method
     * @param  $model
     * @return array
     */
    public function normalize($method, $model)
    {
        return [$model, $this->methods[$method]];
    }
}