Laravel - php artisan migrate doesn't work - laravel

I'm trying to migrate my auth tables but when i do php artisan migrate nothing happens. It shows no error, nothing.
Before run this command i ran php artisan make:auth and work well.
Thanks

Check if you have migration that were not ran yet. If you have one, run composer dumpauto command to register this migration and then run php artisan migrate again.
You can find all executed migrations in the migrations table.

Related

Laravel package migrations not available after migrate:fresh

I've installed this package following the instructions.
Now if I run migrate:fresh the wink tables are not there. For other packages the tables are created so I'm not sure why this is.
If I run php artisan wink:migrate it does create the tables, but as I often run php artisan migrate:fresh --seed I would like the wink tables to be created on that command and directly seed them with data like I do with other packages.
For some reason, the author of this package creates a custom command for migration and as can see on official documentation of it After each update, make sure you run these commands: php artisan wink:migrate.
You can overcome this by creating a custom Artisan command.
For example make php artisan make:command FreshDatabase and in that class add what you need, i.e. call:
php artisan migrate:fresh --seed
php artisan wink:migrate
How to create a custom command, you can see on the Laravel Documentation. Source: https://laravel.com/docs/7.x/artisan

laravel telescope nothing to migrate

i have a laravel 6 app that i want to install the telescope in that i did all the commands like composer update and composer dump-autoload and then i install the telescope every thing is going fine and when i run php artisan telescope:install i get the message below :
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.
but it wont generate the config file and migration so when i run php artisan migrate i get this message :
nothing to migrate
in your command
php artisan vendor:publish --tag=telescope-migrations
then edit you your env file
TELESCOPE_ENABLED=true
after this run
php artisan optimize
Finally
php artisan migrate
You must publish it first using the below command:
php artisan vendor:publish --tag=telescope-migrations
Then you will get the default migrations and also the config/telescope.php file
After installing the telescope in my project and exporting the default migration I got this error.
λ php artisan vendor:publish --tag=telescope-migrations
Unable to locate publishable resources.
Publishing complete.
How I solve this issue
If you're getting this issue open telescope.php file which is inside of your config directory.
and then set the value of this TELESCOPE_ENABLED to true
'enabled' => env('TELESCOPE_ENABLED', true),
Because in my case the value of TELESCOPE_ENABLED this was false
Then again run this command php artisan vendor:publish --tag=telescope-migrations.
I hope it will work :)
I had accidentally ran php artisan optimize in my local environment which was causing this issue. To fix it, I had to run php artisan optimize:clear, then uninstall laravel/telescope, remove any references to it, and install it again from scratch. It then recognised the migrations and the published assets.
I did this
composer remove laravel/telescope
Then change your .env file
TELESCOPE_ENABLED=true
Then install back again it worked!

PHP Artisan Tinker not working with Laravel 5.5.16

I run php artisan tinker but it didn't work it just show a message like this
c:\xampp\htdocs\app_tpa>php artisan tinker
[ErrorException]
rmdir(C:\Users\KIMUNG~1\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty
I tried to run composer require laravel/tinker, but it doesn't fix my problem
This issue is now resolved as per these github issues:
laravel/tinker#29
bobthecow/psysh#430
The proper solution now is to do composer update

Laravel Php artisan make migration error

what i need is need to create_attendance_table using php artisan make:migration create_attendance_table.
But it gets an error like this in my cmd
How can i fix this error?
Seems like you have first created a create_attendance_table and deleted it. The error came across because it couldn't find that deleted migration file. To get rid of error
First hit command
composer dump-autoload
and then,
php artisan make:migration create_attendance_table
Hope this will help you.
for creating migration file you need this command like
php artisan make:migration create_users_table --create=users
for your table :
php artisan make:migration create_attendance_table --create=attendance
your command will migrate existing file, so that's why that error came.
Please read documentation for further details.

Error while running again php artisan session:table command in Laravel 5.2

I am beginner to Laravel, when i run the command "php artisan session:table" first time it successfully created the session migration but unfortunately i have deleted this file. Now when running again this command "php artisan session:table"
its getting error.
error
Please tell me where laravel stores that information that session migration is already created.
Regards,
Kamal
Delete CreateSessionsTable migration in this folder
database/migrations
Run
composer dump-autoload
Then you can run
php artisan session:table
again.

Resources