I am following this tutorial here https://www.youtube.com/watch?v=Jbt5bEgv_QM and got stuck in the php artisan migrate part because of this issue. I'm not sure if it's compatibility issue or something. I am fairly new to laravel.
Here's the database.php file and .env file.
UPDATE: i managed to perform the migration using the solutions provided by the user PHP. However, i couldn't find the table in my phpMyAdmin. do i need to change mySQL root password for that? i have actually set the password but in .env and database.php files i left it blank because the migration works that way. if i set the actual password in both files, I'd get access denied error.
Here's the migration files...
php artisan migrate:rollback then run php artisan migrate.
If you make changes to your migration files, simply run php artisan migrate:refresh
1)First you have to Create your related Database.
2)Then:php artisan cache:clear
3)Now run php artisan migrate:install
Related
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 am trying to configure a new laravel project however I always get the following error no matter what:
file_put_contents(C:\Users\bla...\Documents\GitHub\project\storage\framework/sessions/yB2Ji8maEDu0fXZLpZ5VBnDzIhLdaeA7aYdVMjOf): failed to open stream: No such file or directory
I have tried re installing homestead/laravel/vagrant I have also ran the following and more artisan command again and again:
php artisan config:cache
php artisan cache:clear
php artisan optimize
I have also ran chmod privileges on files/folders inside of my vagrant box but still nothing gets me past this error, any ideas? The project itself is created perfectly fine inside of my vm.
Delete all the files in yourProject/storage/framework/sessions, then run php artisan view:clear and php artisan config:clear
I have a problem with my project laravel 5.7. I have developed it locally and all is well but once sent to my server online I have this error: view [auth.login] not found.
Ran into the same problem. I noticed three things;
A message while booting homestead about virtualbox guest-tools being out of sync between host and guest. There could be a problem with paths. I fixed that issue with the help of this here
The Laravel view [auth.login] not found on server page displayed the path of the host machine and not of the vagrant-guest.
bootstrap/cache/config.php also displayed paths from the host and not the guest.
Renaming/deleting (or artisan cache:clear) the config.php only gave errors (Laravel Error “Unable to load the ”app“ configuration file”).
I fixed the issue by correcting the paths in config.php manually to the correct path in vagrant.
Run following commands on your server.
it might solve your problem.
php artisan config:clear
php artisan cache:clear
php artisan view:clear
php artisan route:cache
php artisan optimize
or
composer dump-autoload -o
if you are in develop mode you can run:
php artisan config:clear
or if you are in product mode you can run:
php artisan config:cache
notice: when you use second, config clear and cache again and you force to repeat command for other changes.
When I migrate the table, the php artisan migrate does not work.
Use composer.
Navigate to the root directory of the project. Run,
php artisan october:up
if you want to roalback you can run
php artisan october:down
Be sure to use composer in the project directory
php artisan migrate:refresh php artisan migrate:rollback php artisan migrate --force are some cmd's you could try. I don't know if this helps you otherwise please explain your question a bit more.
Go to the root directory of your project in command prompt and run these commands
To reset the current migrations if there are some php artisan migrate:reset
then run php artisan migrate
I have 2 databases and I used the following command:
php artisan migrate:refresh
This cleared both databases and rebuilt the tables, however I'd like to do this only for a single database. How can I do this?
Try using the --database option:
php artisan migrare:refresh --database=connectionName
For future reference, you can get help with arguments and options for any Artisan command by running:
php artisan help CommandName