如何检查在laravel 4.2中创建的数据库表?

时间:2016-01-20 01:37:47

标签: php database migration schema laravel-4.2

我是laravel的新手,有人知道如何查看已创建的数据库表吗?我一直在使用模式构建器创建表之后迁移数据库并停留。这是我的代码

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('users', function($table)
        {
            $table->increments('id');
            $table->string('nim');
            $table->string('name');
            $table->string('password');
            $table->string('level');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}

1 个答案:

答案 0 :(得分:0)

新表名称将是“users”,因为您已在Schema :: create函数中指定了“users”作为名称。

如果您正在使用phpmyadmin数据库,那么您可以从mysql查看该表,该数据库被作为laravel的默认数据库。