How to run Migration in laravel project for database
1. Basic Migration: Assuming you have created migrations using php artisan make:migration MyMigrationName (replace with your desired name), run the following command to apply all pending migrations: php artisan migrate 2. Specific Options: You can utilize various options with the migrate command: --pretend : Simulates the migration process without actually making changes to the database (useful for testing). --seed : Runs the database seeders after applying migrations (for adding initial data). --force : Forces the migration to run even if there are potential risks like data loss. Use with caution! Here are some examples: php artisan migrate --pretend # Simulate migration php artisan migrate --seed # Migrate and seed php artisan migrate --force # Force migration (use carefully) 3. Specific Migrations: To run a specific migration by its migration file name: php artisan migrate --path=database/migrations/MyMigrationName.php Replace MyMigrationName.php ...