@Nakov
sorry, maybe my explanation was not clear enough. Here is what I mean - if you add another ****.php file into the public folder of the project like phpinfo.php it will not be executed if you are using the default Laravel Valet driver.
In my case into the public folder I have a subfolder called "uploads" where another index.php file is presented and the uploading logic is added into this file. This is why I said that ***.php files are not supported but missed to clarify my case.
Below I'm pasting what I have added as custom LocalValerDriver in the project folder in order to execute the other .php files into the public folder:
<?php
class LocalValetDriver extends LaravelValetDriver
{
private $site_folder = '/public';
/**
* 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 true;
}
/**
* 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.$this->site_folder.$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)
{
$path = $sitePath.$this->site_folder;
return strpos($uri, '.php')
? $path.$uri
: $sitePath.'/public/index.php';
}
}
Credits for the above code are for the guy from this post: https://github.com/laravel/valet/issues/424#issuecomment-375432585