brefphp/bref

Feedback for “Serverless Laravel - Getting started”

crgdncn opened this issue · 3 comments

Before running "serverless deply", check the serverlerss.yml file to be sure that you have the correct version of php. For example, Laravel 11 requires php 8.2.

runtime: php-82-fpm

If you have not set up a database in AWS, I suggest you move or remove the default migrations files to another directory.

Additionally, set the following .env variables
APP_MAINTENANCE_STORE=array
LOG_CHANNEL=stderr
SESSION_DRIVER=array
CACHE_STORE=array
DB_CONNECTION=

In my config/database.php I set the default db connection to a null string
'default' => env('DB_CONNECTION', ''),

After that, the default laravel page worked as expected :-)

Hi @crgdncn!

Additionally, set the following .env variables
APP_MAINTENANCE_STORE=array
LOG_CHANNEL=stderr
SESSION_DRIVER=array
CACHE_STORE=array
DB_CONNECTION=

The package bref/laravel-bridge sets most of those values1 to allow a fresh Laravel app to work right away.

Did you install the bref/laravel-bridge package?

Footnotes

  1. Bref Docs > Laravel > Setup

Echoing some of what @crgdncn mentioned with regards to Laravel 11, specifically needing to set the specific runtime, and make sure it's not using any DB_CONNECTION (or at least setting the SESSION_DRIVER to "file" so it stops trying to use a non-existent DB by default for sessions.)

I think Bref just needs some tweaking for Laravel 11 is all 😄

Thanks, yeah it looks like we need to improve the docs and the bridge. Adding that to my todolist, if anyone wants to look at it too feel free.