Laravel package migrations not available after migrate:fresh - laravel

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

Related

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.

There are no commands defined in the "passport" namespace. When installing API Authentication In laravel

I am getting below error when i run
php artisan passport:install
[Symfony\Component\Console\Exception\CommandNotFoundException]
There are no commands defined in the "passport" namespace.
For installing laravel passport make sure you add this line to config/app.php in the providers array (package service providers section):
Laravel\Passport\PassportServiceProvider::class,
Then install the package and migrate the database
composer require laravel/passport
php artisan migrate
php artisan passport:install
Clearing out the cache is generally helpful first step when commands are not working, especially when you update anything in the config folder on .env files.
php artisan config:clear
php artisan config:cache
Config clear removes the configuration cache file. Config cache creates a new configuration cache file with the current settings. Config cache enables faster load times for your apps!
I got solution. After running following two commands every thing work fine.
run php artisan cache:clear
run php artisan config:cach
I was searching for a solution for this and I found simple one that worked for me:
Add these lines to $commands array in app/Console/Kernel.php
\Laravel\Passport\Console\InstallCommand::class,
\Laravel\Passport\Console\KeysCommand::class,
\Laravel\Passport\Console\ClientCommand::class,
Try running composer require laravel/passport "~9.0" before running php artisan passport:install
Just follow these steps:
composer require laravel/passport.
Once the installation finishes, add the following provider in the config/app.php file: Laravel\Passport\PassportServiceProvider::class,
php artisan migrate
php artisan passport:install
Here Is the solution of install Laravel passport with mongodb:
Just replace the Illuminate\Database\Eloquent\Model; with Jenssegers\Mongodb\Eloquent\Model in below files:
..\vendor\laravel\passport\src\Token.php,
..\vendor\laravel\passport\src\AuthCode.php
..\vendor\laravel\passport\src\Client.php
..\vendor\laravel\passport\src\PersonalAccessClient.php
and protected $table= "Table_name" variable with protected $collection="Table_name"

Laravel - php artisan migrate doesn't work

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.

Laravel VentureCraft/revisionable error migration table

I have a problem with install VentureCraft/revisionable in Laravel.
When I trying use this command:
php artisan migrate --package=venturecraft/revisionable
Artisan returned error:
[Symfony\Component\Console\Exception\RuntimeException] The "--package"
does not exist.
I using Laravel version 5.2
Simply, you can migrate by:
php artisan migrate --path=vendor/venturecraft/revisionable/src/migrations
The --package syntax was only available in Laravel 4. It seems like this package has old documentation based off that release.
You'll need to go into the vendor/venturecraft/revisionable/migrations folder and copy the migration and insert it in your database/migrations folder.
Then run the command php artisan migrate.

Laravel 5.1 - artisan make command

in Laravel 4.2 by using JeffreyWay/Laravel-4-Generators we could use
php artisan generate:view my-view
to create a view named my-view.blade.php.
Now in Laravel 5.1 what we should use to generate a view?
php artisan make:???
According to package's developer, you need to use L5 version instead. Now you are able to run php artisan generate:view.
As a reminder, these commands are not native of laravel artisan console.
In laravel 5.1 no artisan command for make/generate view.
You can install sven/artisan-view package to make view from CMD, to install package write this command:
composer require sven/artisan-view --dev
After installing it, you can make a single view or folder with all views that contain {index-create-update-show}
To make a single file we using this command:
php artisan make:view Name_of_view
For example
php artisan make:view index
To make a folder that contain all resources index - create - update - show write name of folder that contain all this files for example:
php artisan make:view Name_of_Folder -r
For example:
php artisan make:view blog -r
-r is a shorthand for --resource you can write full name or shorthand to make resource.
For more view docs

Resources