Valet is a Laravel development environment for Mac minimalists.
This is the very first line of the introduction in the documentation for valet. Based on that I assume that it will not work for anything other than Laravel.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Would really appreciate it if someone could help. I've just installed Laravel Valet and it serves Laravel sites and static html sites fine but I get a 404 with site that uses php but no framework. Is there any way to solve this?
Just for anyone that wants to copy and paste a Driver. This is my BasicPHPValetDriver.php file stored in ~/.valet/Drivers. It works with urls that either have or don't have the .php extension. :)
<?php
class BasicPHPValetDriver 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)
{
if (file_exists($sitePath.'/index.php')) {
return true;
}
return false;
}
/**
* Determine if the incoming request is for a static file.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
* @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 ($uri == '/')
return $sitePath.'/index.php';
return strpos($uri, '.php') ? $sitePath.$uri : $sitePath.$uri.'.php';
}
}
Please or to participate in this conversation.