Can't remove personal_access_tokens from migration
Today I created a new project and noticed that in migration folder there is a new file named:
personal_access_tokens
I know it belongs to Sanctum package, and because I don't use Sanctum I removed the migration, then run php artisan migrate but it migrated this table also.
I couldn't find out how to remove this migration entirely.
Well knock me down. That’s gross. Not every project needs Sanctum so why Taylor’s decided it should come pre-installed in every Laravel application now, I have no idea.
Simple answer is to remove it if you don’t need it: composer remove laravel/sanctum
Not knowing why it was installed, I didn't know whether I could remove it. Thanks!
One thing to note when you do uninstall it though, the default User model is calling Laravel\Sanctum\HasApiTokens, but it's not doing anything with it. Hopefully there aren't any more little Sanctum tendrils I'm missing!
@syarifhd_ Please read whole the discussion before giving an solution next time. That file was deleted but the migration 2019_12_14_000001_create_personal_access_tokens_table still ran.
The right solution so far for this case cames from @william77470
Call the Sanctum::ignoreMigrations method in the register method of your App\Providers\AppServiceProvider class. Then remove database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php
https://laravel.com/docs/10.x/sanctum#migration-customization