src/Domain/Traits/CheckableTrait.php
protected function runChecks($action, $input = [], $original = [])
    {
        // Perform a basic check to see if the current action is authorised
        // to be performed on this resource
        $this->checkAuthorisation($action);

        // If input data is given
        if (! empty($input)) {
            // Run input validation on the input data
            $filtered = $this->applyValidationRules($action, $input);

            // Run business rule validation on the input data
            $this->applyDomainRules($action, $input, $original);

            return $filtered;
        }
    }
protected function runChecks($action, $input = [], $original = [])
    {
        // Perform a basic check to see if the current action is authorised
        // to be performed on this resource
        $this->checkAuthorisation($action);

        // If input data is given
        if (! empty($input)) {
            // Run input validation on the input data
            $filtered = $this->applyValidationRules($action, $input);

            // Run business rule validation on the input data
            $this->applyDomainRules($action, $input, $original);

            return $filtered;
        }
    }
protected function runChecks ( $ action , $ input = [ ] , $ original = [ ] ) { // Perform a basic check to see if the current action is authorised // to be performed on this resource $ this -> checkAuthorisation ( $ action ) ; // If input data is given if ( ! empty ( $ input ) ) { // Run input validation on the input data $ filtered = $ this -> applyValidationRules ( $ action , $ input ) ; // Run business rule validation on the input data $ this -> applyDomainRules ( $ action , $ input , $ original ) ; return $ filtered ; } }
Run required checks for given action.
@param  string  $action   Requested action to check
@param  array   $input    Input data relevant to checks
@param  array   $original Original data from the model
@return array             InputFilteredData if $input is provided
Run required checks for given action .