Install laravel passport in laravel vapor environment - laravel

Installing Passport worked for the local environment of Laravel Vapor. But after deploying it to production an error occured:
After searching the error message it seems that we need to run php artisan passport:install like mentioned here.
How can we do that with Laravel Vapor? Is there a way to get access to the server via ssh?

Vapor doesn't have a permanent filesystem; each HTTP request hits a new Lambda instance.
The docs have some info on deploying Passport keys. On Vapor, your best bet is going to be using Vapor's "secrets" system to put them into the environment, then doing:
php artisan vendor:publish --tag=passport-config
which will then provide the option to load the encryption keys from your environment variables:
You'll want to name your secrets PASSPORT_PRIVATE_KEY and PASSPORT_PUBLIC_KEY in Vapor.

Related

Laravel deploying 403 Access Forbideen

I'm trying to deploy my laravel 8 project in my hosting.
After I publich whole files of the projct, I got the 403 Access Forbidden.
My websites on the server work perfectly, but this project I don't know what's is the problem.
And I'm sure that the problem in the project files not in the server.
This is the website: [Sheeks] (http://manage-sheek.manarat-free.com/)
If all of your configurations at server is correct then it's because of cached data. Run commands:
php artisan config:cache
php artisan route:cache

Heroku Laravel 500 (Internal Server Error) oauth-public.key does not exist

OAUTH Public Key is Here
oauth-public.key is exist
I uploaded a question board using Laravel, Vue, RESTful API on Heroku.
When I log in and add a question, I get a 500 (Internal Server Error) called
"Key path \"file:///app/storage/oauth-public.key\" does not exist or is not readable".
Github: https://github.com/2020software/Sample-Vuedev
Heroku Question board: https://samplevueqa.herokuapp.com/
Login id : text#example.com
Login pw: password
Thank you for those who have solved the same problem!
Verify that the file in fact doesn't exist, rather than just having incorrect permissions
Verify that it also doesn't exist in app/storage/app. I've had it happen where Passport's default location for creating new keys didn't quite match where the Auth middleware was looking. You can fix this in config/filesystems.php if need be.
Make sure to run php artisan passport:keys
I runned heroku ps:exec -a your_app_name next run php artisan passport:keys I solved!!

laravel deployment failed on heroku

Some months ago I succeeded in deploying a Laravel 5.5 application on Heroku.
I tried to do the same today with a Laravel 6.12 application, and I have a lot of problems. I added the .env vars, I added the Procfile. But I have this error:
Did something change between Laravel 5.5 and 6 for deploying to Heroku? How can I get this working?
My post-install-cmd is:
"post-install-cmd": [
"php artisan cache:clear",
"php artisan config:cache",
"chmod -R 777 storage",
"php artisan passport:keys"
]
You're using the default file session driver, but this isn't a good fit on Heroku. Its filesystem is ephemeral and local to each dyno.
Try using a different session driver by setting the SESSION_DRIVER environment variable:
heroku config:set SESSION_DRIVER=cookie
cookie is probably simplest, but memcached or redis would work well too if you have either of those set up.
The default session driver didn't change between Laravel 5.5 and 6, but I wouldn't recommend using file with Laravel 5.5 on Heroku either.

Laravel can't access database

I cvurrently have a laravel application running on heroku, the issue here is, I keep getting the error that I can't connect to the database: SQLSTATE[HY000] [1045] Access denied for user 'user'#'ec2-54-74-209-179.eu-west-1.compute.amazonaws.com' (using password: YES). Now the host is wrong here, the environment files are TOTALLY different (except for the username) then what the error gives....
How can I resolve this issue?
I've tried to use the DB_URL env, but that gives the same result...
Did you set the .env correctly on what's running on their server?
You can see all your projects in laravel at TOOLS->DEPLOYEMNT->CONFIGURATIONS
add all the info and connect to the remote project. I did the same and changed the .env directly there.
and of course you have to clean all the cache cause even if you change the .env it will not work until you'll clear it
php artisan cache:clear;
php artisan config:clear;
php artisan route:clear;
Obviously this need to be executed on the project on heroku or aws (as it appears from the Error)

Api auth middleware is not working on serve but working in local

Api auth middleware is not working on serve
I have an exactly same problem. Please help me.
Did you run php artisan passport:install on server? Do you have valid oauth keys in storage folder on server??
if not then run the command on server by using ssh or any other accessible server terminal:
php artisan passport:install

Resources