Question

Using artisan migrate command, i am trying to create the table. users table is created but not the columns. What could I check ?

use Illuminate\Database\Migrations\Migration;


class CreateUsersTable extends Migration {

public function up()
{
    Schema::create('users', function($table)
    {
        $table->increments('id');
        $table->string('email');
        $table->string('password');
        $table->timestamps();
    });
}
Was it helpful?

Solution

Upon running the above migration file, the table and its columns are successfully created in the database. If you see that the users table is created but not the columns in it, then you might not be looking properly.

I am writing the following answer on my assumption that you're very new to web development also and might not be acquainted with the tools yet.

I assume you're using phpMyAdmin to view your database. If you go to your database and then the users table, you'll be in the Browse tab. Of course, it will be empty because there are no data inserted in the users table, but if you click the Structure tab, then you can view the schema of your users table and see that the columns are created.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top