mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
detect preferred site with introducing a new variable
This commit is contained in:
@@ -126,7 +126,6 @@ function valet_default_site_path($config)
|
||||
* Inspects registered path directories, case-sensitive.
|
||||
*/
|
||||
$valetSitePath = null;
|
||||
$valetSitePathByDomain = null;
|
||||
$domain = array_slice(explode('.', $siteName), -1)[0];
|
||||
|
||||
foreach ($valetConfig['paths'] as $path) {
|
||||
@@ -141,15 +140,13 @@ function valet_default_site_path($config)
|
||||
break;
|
||||
}
|
||||
if (strtolower($file) === $domain) {
|
||||
$valetSitePathByDomain = $path.'/'.$file;
|
||||
$valetSitePath = $path.'/'.$file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
||||
|
||||
$valetSitePath = $valetSitePath ?: $valetSitePathByDomain;
|
||||
|
||||
if (is_null($valetSitePath) && is_null($valetSitePath = valet_default_site_path($valetConfig))) {
|
||||
show_valet_404();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user