1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 00:20:08 +01:00
Files
laravel-valet/cli/stubs/SampleValetDriver.php
2025-02-12 01:38:26 +00:00

41 lines
1004 B
PHP

<?php
namespace Valet\Drivers\Custom;
use Valet\Drivers\ValetDriver;
class SampleValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*/
public function serves(string $sitePath, string $siteName, string $uri): bool
{
// if (file_exists($sitePath.'/file-that-identifies-my-framework')) {
// return true;
// }
return false;
}
/**
* Determine if the incoming request is for a static file.
*/
public function isStaticFile(string $sitePath, string $siteName, string $uri)/* : string|false */
{
if (file_exists($staticFilePath = $sitePath.'/public/'.$uri)) {
return $staticFilePath;
}
return false;
}
/**
* Get the fully resolved path to the application's front controller.
*/
public function frontControllerPath(string $sitePath, string $siteName, string $uri): string
{
return $sitePath.'/public/index.php';
}
}