Skip to content

Commit 92c40a6

Browse files
Merge pull request #322 from N1ebieski/Fix-LaravelVsCoderelativePath-when-path-does-not-exist-#16
Fix laravel vs coderelative path when path does not exist
2 parents 2a3bacc + a85b559 commit 92c40a6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

php-templates/bootstrap-laravel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public static function relativePath($path)
1414
return (string) $path;
1515
}
1616

17-
return ltrim(str_replace(base_path(), '', realpath($path)), DIRECTORY_SEPARATOR);
17+
return ltrim(str_replace(base_path(), '', realpath($path) ?: $path), DIRECTORY_SEPARATOR);
1818
}
1919

2020
public static function isVendor($path)

src/templates/bootstrap-laravel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class LaravelVsCode
1414
return (string) $path;
1515
}
1616
17-
return ltrim(str_replace(base_path(), '', realpath($path)), DIRECTORY_SEPARATOR);
17+
return ltrim(str_replace(base_path(), '', realpath($path) ?: $path), DIRECTORY_SEPARATOR);
1818
}
1919
2020
public static function isVendor($path)

0 commit comments

Comments
 (0)