From 48df7cf739459d7639660d7b640ae6b8beace0d5 Mon Sep 17 00:00:00 2001 From: Denis Alustau Date: Mon, 13 Nov 2023 16:45:07 +0100 Subject: [PATCH] Add slash in the end of laravel home path when use realpath --- src/LaravelHomeResolver.php | 24 ++++++++++++++++++++++++ src/bref-init.php | 16 ++-------------- 2 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 src/LaravelHomeResolver.php diff --git a/src/LaravelHomeResolver.php b/src/LaravelHomeResolver.php new file mode 100644 index 0000000..069c84f --- /dev/null +++ b/src/LaravelHomeResolver.php @@ -0,0 +1,24 @@ + new HandlerResolver); - -function resolveBootstrapLocation(): string -{ - $laravelHome = $_SERVER['LAMBDA_TASK_ROOT'] . '/bootstrap/cache/config.php'; - - if (file_exists($laravelHome)) { - return $_SERVER['LAMBDA_TASK_ROOT']; - } - - // Going up 4 directories will get us from `vendor/brefphp/laravel-bridge/src` to the Laravel root folder - return realpath(__DIR__ . '/../../../../'); -}