Answer the question
In order to leave comments, you need to log in
How to solve route problem in SleepingOwl Laravel admin?
Hello.
SleepingOwl admin problem.
When you click on the button of the ckeditor editor "Download image from the server" accesses the controller \vendor\sleeping-owl\admin\src\SleepingOwl\Admin\Controllers\[email protected] and all images are loaded there and parameter slashes are encoded when getting the path through route() in the \Illuminate\Routing\[email protected]() class.
\vendor\sleeping-owl\admin\src\SleepingOwl\Admin\Controllers\[email protected]
...
function __construct(Finder $finder, Filesystem $filesystem)
{
$this->finder = $finder;
$this->filesystem = $filesystem;
}
/**
* Get all images within "images" directory without "seeds" subdirectories
*
* @return array
*/
public function getAll()
{
$files = $this->getAllFiles();
$result = [];
foreach ($files as $file)
{
$result[] = $this->createImageObject($file);
}
return $result;
}
/**
* @return Finder
*/
protected function getAllFiles()
{
return $this->finder->create()->exclude('seeds')->files()->in(Config::get('admin.imagesDirectory'));
}
/**
* @param SplFileInfo $file
* @return StdClass
*/
protected function createImageObject(SplFileInfo $file)
{
$obj = new StdClass;
$path = $file->getRelativePathname();
$obj->url = <b>route</b>('imagecache', [
'original',
$path
]);
$obj->thumbnail = route('imagecache', [
'small',
$path
]);
return $obj;
}
..
...
protected function toRoute($route, $parameters, $absolute)
{
$parameters = $this->formatParameters($parameters);
$domain = $this->getRouteDomain($route, $parameters);
$uri = strtr(<b>rawurlencode</b>($this->addQueryString($this->trimUrl(
$root = $this->replaceRoot($route, $domain, $parameters),
$this->replaceRouteParameters($route->uri(), $parameters)
), $parameters)), $this->dontEncode);
return $absolute ? $uri : '/'.ltrim(str_replace($root, '', $uri), '/');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question