bref icon indicating copy to clipboard operation
bref copied to clipboard

Feedback for “Serverless Laravel - Getting started”

Open crgdncn opened this issue 1 year ago • 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 :-)

crgdncn avatar Apr 19 '24 03:04 crgdncn

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 values[^1] to allow a fresh Laravel app to work right away.

Did you install the bref/laravel-bridge package?

[^1]: Bref Docs > Laravel > Setup

hschimpf avatar Apr 26 '24 18:04 hschimpf

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 😄

1000nettles avatar May 11 '24 19:05 1000nettles

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.

mnapoli avatar May 12 '24 15:05 mnapoli