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

feat: Laravel on Cloud Run #1680

Merged
merged 39 commits into from
Dec 13, 2022
Merged

feat: Laravel on Cloud Run #1680

merged 39 commits into from
Dec 13, 2022

Conversation

glasnt
Copy link
Contributor

@glasnt glasnt commented Aug 29, 2022

Code and README-based tutorial for Laravel on Cloud Run

Includes some region tags as highlighted in "Understanding the code".

(View to possibly migrate README tutorial to DevSite, but if that happens I'll submit another PR to redirect readers to that version)

@glasnt glasnt requested a review from a team as a code owner August 29, 2022 23:07
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Aug 29, 2022
@snippet-bot
Copy link

snippet-bot bot commented Aug 29, 2022

Here is the summary of changes.

You are about to add 2 region tags.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@glasnt
Copy link
Contributor Author

glasnt commented Aug 29, 2022

Unsure why linting is failing.


Files that were not fixed due to errors reported during linting before fixing:
   1) /tmpfs/src/github/php-docs-samples/run/laravel/app/Providers/RouteServiceProvider.php

@saranshdhingra
Copy link
Collaborator

@glasnt I believe that is happening due to the use of ?-> operator in the RouteServiceProvider.php file. This was introduced in PHP 8, while the linter is running an image containing PHP 7.4 see this.

When I ran the fixer on your PR locally with PHP 7.3 in verbose mode I got the "Invalid file syntax" error.
On PHP 8.1 there were no changes.

Now, since this RouteServiceProvider.php is provided by the framework itself, we can either,

  1. Ignore this and force merge.
  2. Downgrade the Laravel version to be the one compatible to PHP 7.4.
  3. Add an exclusion in the config file for php-cs-fixer.

@bshaffer Does this look right?

@glasnt
Copy link
Contributor Author

glasnt commented Nov 4, 2022

tests all pass now 🥳

run/laravel/composer.json Outdated Show resolved Hide resolved
run/laravel/composer.json Show resolved Hide resolved
Copy link
Contributor

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great tutorial!! I was able to get from beginning to end without any issues! I have a few comments related to minor tutorial based things, and only one major issue, which has to do with PHP versions (both required locally and deployed to). Please let me know if you have any questions!

compute/api-client/helloworld/app.php Outdated Show resolved Hide resolved
functions/http_content_type/index.php Outdated Show resolved Hide resolved
run/laravel/tests/Unit/ExampleTest.php Outdated Show resolved Hide resolved
run/laravel/app/Http/helpers.php Outdated Show resolved Hide resolved
run/laravel/routes/web.php Outdated Show resolved Hide resolved
run/laravel/README.md Show resolved Hide resolved
run/laravel/README.md Outdated Show resolved Hide resolved
run/laravel/README.md Outdated Show resolved Hide resolved
run/laravel/README.md Outdated Show resolved Hide resolved
run/laravel/README.md Show resolved Hide resolved
run/laravel/README.md Outdated Show resolved Hide resolved
@@ -0,0 +1,3 @@
web: pid1 --nginxBinaryPath nginx --nginxConfigPath /layers/google.php.webconfig/webconfig/nginx.conf --serverConfigPath /layers/google.php.webconfig/webconfig/nginxserver.conf --nginxErrLogFilePath /var/log/nginx.log --customAppCmd "php-fpm -R --nodaemonize --fpm-config /layers/google.php.webconfig/webconfig/php-fpm.conf" --pid1LogFilePath /var/log/pid1.log --mimeTypesPath /layers/google.utils.nginx/nginx/conf/mime.types --customAppSocket /layers/google.php.webconfig/webconfig/app.sock
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirmed this setup vs the current buildpack web config, and it's still 'up to date', and the logs end up in Cloud Run successfully.

@glasnt
Copy link
Contributor Author

glasnt commented Dec 13, 2022

One noop comment, I'm happy with this being merged when you are.

@bshaffer bshaffer merged commit f9a2245 into GoogleCloudPlatform:main Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
samples Issues that are directly related to samples.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants