/** * Generate a model attribute array from an argument array. * * @param array $args * @return array */ public function getModelAttributes(array $args) { if (!isset($args[0]) || !filter_var($args[0], FILTER_VALIDATE_URL)) { $url = isset($args[0]) ? (string) $args[0] : 'none'; throw new InvalidArgumentException("Invalid url provided. [{$url}]"); } if (isset($args[1]) && !is_int($args[1])) { throw new InvalidArgumentException("Invalid status code. [{$args['1']}]"); } return parent::getModelAttributes(['resource' => $args[0], 'meta' => ['status_code' => isset($args[1]) ? $args[1] : null]]); }
/** * Get the routing path. * * @return string */ protected function getRoutingPath() { $path = parent::getRoutingPath(); return $path . '.gif'; }