skip to Main Content
[Picture 1[1]Picture 2

I have done a php artisan migration but nothing appeard in the database please find a fix that works.As you can see string(‘address’)

2

Answers


  1. You ran migrate earlier, correct? If yes, you can run:

    php artisan migrate:fresh
    

    This will drop existing tables and data and create a new structure.

    Or, if you want to add new fields without losing existing data, you should add a new migration. In that case, the command should be the following.

    php artisan make:migration add_new_field_name_in_table_name --table=table_name
    
    Login or Signup to reply.
  2. The migration looks fine, like any migration. Did the console output display that the migration was processed?

    Migrating: 2021_06_09_102328_create_profiles_table
    Migrated:  2021_06_09_102328_create_profiles_table
    

    If so, it might be a good idea to check the values in your .env:

    DB_CONNECTION=mysql #EXPECTED
    DB_HOST=127.0.0.1 #EXPECTED
    DB_PORT=3306 #EXPECTED
    DB_DATABASE={DB_NAME} #YOUR DB NAME
    DB_USERNAME={DB_USERNAME} #YOUR DB USERNAME
    DB_PASSWORD={DB_PASSWORD} #YOUR DB PASSWORD
    

    And ensure they are the same as the values that you use to connect to phpmyadmin.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search