The table is still in the database because the down method was not run. Your migrations are a snapshot, they do not (and should not) maintain the current state of the schema without your direct running of php artisan migrate!
If you don't need the table (and the migration file already has been removed) then you can delete it in the database directly. Or create a new migration and in the up method dropIfExists the table:
public function up()
{
Schema::dropIfExists('unwanted-table');
}
i deleted directly from database table and i deleted same file from migration folder as well. Now i don't have that migration file but when i run php artisan migrate:fresh
it creates same table name again in database. I am suprised how it is happening even though i deleted migration file of that particular table
If I choose to delete a migration file... I remove all tables in the db then just migrate. Migrations are design to move forward and backward not really to remove things in the middle. If that makes sense.
Sometimes it's better to avoid running migration in different environments, but instead of removing it from the codebase, it's better to make it empty. Your code can look like this:
<?php
use Abagayev\Laravel\MigrationShortcuts\Migrations\EmptyMigration;
class MyMigration extends EmptyMigration
{
//
}
To make it work you need to install Laravel Migration Shortcuts package as well: