I have a laravel app with api. I use Passport to authenticate and manage tokens. On my mac everything work, but when i deploy it and run php artisan migrate it only migrate files that in project/database/migrations. There is another migrations files in project/vendor/laravel/passport/database/migrations there are dont migrate on server, but migrate on my local machine.
Maybe there are some permission problems. You could check that with ls -l on the project/vendor/ directory.
Another way is to publish the migrations
php artisan vendor:publish --tag=passport-migrations
Related
Laravel 7.28 not work without php artisan serve command in localhost
I install new Laravel in localhost (/var/www/html/NewLaravel)
When I run http://localhost/NewLaravel/public/ not workling
but when I run with php artisan serve its working on http://127.0.0.1:8000/
Apache2 is working proper and allow access of override for .htaccess
is that new Laravel will only work with php artisan serve ?? or something is missing from my side ?
Step-1:
run apache and sql from xampp server
step-2:
in browser type localhost/NewLaravel and press enter
Step-3:
in list please select public folder it will run
I am trying to get all data from the database. It's returning an empty array if I use Laravel Homestead mapped site, but it works fine with:
php artisan serve
php artisan tinker
I can't find any mistake. I made migration, model and controller. Homestead.yaml is okay (mapping and database name are fine), /etc/hosts also, updated .env file. I tried different solutions I found here, including:
protected $table
php artisan config:cache
php artisan config:clear
reinstalling mysql
I did not work. And even with:
vagrant halt
vagrant up
vagrant provision
Is there any solution to fix this or should I use "php artisan serve" ?
I am using Linux, VirtualBox, Homestead v10.9.1, PHP 7.4.7, Laravel Framework 7.17.2
I used laravel storage class to upload images in the storage folder. it successfully upload images and I can successfully access them by Storage::url('path'); or Storage::download('path');
however, when I copy the project to another location and try to run my copied project using php artisan serve, I can not access the images! this is while the original project is still fine and images are accessible.
it is noteworthy that I already used php artisan storage:link in the original folder. When I run php artisan storage:link in the copied folder it says it already exists. It is interesting that Storage::url('path') creates the url correctly and images are also copied correctly in the new location.
How can I fix this problem?
will this be a problem if I deploy the project in a web host?
Firstly Remove Storage Link from public folder by running
rm public/storage
And then try to run below command
php artisan storage:link
try to run clear cache and config. may be because of cache settings so try this
php artisan cache:clear
php artisan route:cache
php artisan view:clear
php artisan config:cache
I have created(installed composer create-project laravel/laravel basicwebsite) project named basicwebsite.
After that i run php artisan serve then it showed some URL then i got LARAVEL page in browser,fine.
(Accidentally, my system is shut down.)
To reopen the project ,in cmd prompt i just did as
php artisan serve
and the error occur is
I almost searched for solution in all websites(including stack) .All started with create project but not what to do after close and opened the project.
Thanks in advance.
Use php artisan config:clear command to clear cache. You should see
Configuration cache cleared
Use php artisan serve command to start the server.
Error States:
The localhost page isn’t working
localhost is currently unable to handle this request.
HTTP ERROR 500
my project is in htdocs>laravel>project1>public>index.php
any more details like installation etc?
how did you install the laravel project by php artisan command or by composer or by zip package? and why you want to run your laravel project with the xammp file structure.. you can simply write the "php artisan serve" in your command line.. also make sure the .env variables set properly.. also try to clear all cache browser and run following query and try again
php artisan cache:clear
you need to know that the default port of laravel project is localhost:8000
When you meet 500 error, it's usually permissions related problem. Set write permissions on a storage directory. For Linux:
sudo chmod -R 775 storage
If it didn't help, look into Laravel error log.