The hardcoded option getcwd() will always resolve to /var/task/ and will require that the Laravel installation must be done at the root of the project. Variables like BREF_AUTOLOAD_PATH always allowed us to deviate from the default since we could point Bref to the proper position of the autoloader.
This PR opens up an optional parameter at the constructor of the OctaneHandler so that we can write our own file-based Bref Handler as follows:
<?php declare(strict_types=1);
use Bref\LaravelBridge\Http\OctaneHandler;
return new OctaneHandler(__DIR__ .'/../../../my/path/to/laravel/root/folder');
Having this as the Entrypoint of Lambda allows us to reuse all of the code present in this package while still being able to customize Laravel.
The hardcoded option
getcwd()
will always resolve to/var/task/
and will require that the Laravel installation must be done at the root of the project. Variables likeBREF_AUTOLOAD_PATH
always allowed us to deviate from the default since we could point Bref to the proper position of the autoloader.This PR opens up an optional parameter at the constructor of the
OctaneHandler
so that we can write our own file-based Bref Handler as follows:Having this as the Entrypoint of Lambda allows us to reuse all of the code present in this package while still being able to customize Laravel.