public function url($url, $width = null, $height = null, $options = null) { if (strpos($url, URL::to('/')) === 0) { $url = substr_replace($url, '', 0, strlen(URL::to('/'))); } if (preg_match('#^/(' . config('coaster::frontend.croppa_handle') . ')$#', $url)) { $url = '/cache' . $url; } return parent::url($url, $width, $height, $options); }
/** * Pass through URL requrests to URL->generate(). * * @param string $url URL of an image that should be cropped * @param integer $width Target width * @param integer $height Target height * @param array $options Addtional Croppa options, passed as key/value pairs. Like array('resize') * @return string The new path to your thumbnail * @see Bkwld\Croppa\URL::generate() */ public function url($url, $width = null, $height = null, $options = null) { $config_ignore = Config::get('croppa.ignore'); return $width == null && $height == null || preg_match('#' . $config_ignore . '#', $url) ? $this->rawUrl($url) : parent::url($url, $width, $height, $options); }