Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixes the Responsive Filemanager when running a Coaster project locally with Laravel Valet.
<?php
class CoasterValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return void
*/
public function serves($sitePath, $siteName, $uri)
{
return is_dir($sitePath.'/public/coaster');
}
/**
* Determine if the incoming request is for a static file.
*
* @param string $sitePath
* @param string $siteName
* @return string|false
*/
public function isStaticFile($sitePath, $siteName, $uri)
{
if (file_exists($staticFilePath = $sitePath.'/public'.$uri)) {
return $staticFilePath;
}
return false;
}
/**
* Get the fully resolved path to the application's front controller.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @return string
*/
public function frontControllerPath($sitePath, $siteName, $uri)
{
if (strpos($uri, '/coaster/filemanager') !== false) {
return $sitePath.'/public'.$uri;
}
return $sitePath.'/public/index.php';
}
}
@unrivaledcreations

This comment has been minimized.

Show comment
Hide comment
@unrivaledcreations

unrivaledcreations Aug 10, 2017

Worked like a champ! I copied this file into my ~/.valet/Drivers folder, then ran valet restart to fix the 404 Coaster responsive file manager error.

Worked like a champ! I copied this file into my ~/.valet/Drivers folder, then ran valet restart to fix the 404 Coaster responsive file manager error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment