protected function parseConditionalParameters($action)
{
// Retrieve parameters. Accept only string or array.
// This help filter the $action parameters as it might also be a Closure.
$parameters = Arr::first($action, function ($value, $key) {
return is_string($value) || is_array($value);
});
if ($this->condition() && !is_null($parameters)) {
if (is_string($parameters) && strrpos($parameters, '@') !== false) {
/**
* In case of a controller value statement, return empty array.
*/
return [];
}
return is_array($parameters) ? $parameters : [$parameters];
}
return [];
}