Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback for “Serverless Laravel - Getting started” #1792

Open
crgdncn opened this issue Apr 19, 2024 · 3 comments
Open

Feedback for “Serverless Laravel - Getting started” #1792

crgdncn opened this issue Apr 19, 2024 · 3 comments

Comments

@crgdncn
Copy link

crgdncn commented Apr 19, 2024

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 :-)

@hschimpf
Copy link

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

@1000nettles
Copy link

1000nettles commented May 11, 2024

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 😄

@mnapoli
Copy link
Member

mnapoli commented May 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants