laravel 5.4 can't php artisan migrate 教学

当 php artisan migrate
出现以下状况时:

In Macroable.php line 74:  Method id does not exist.

如果是原始建立的专案会有create_users_table以及create_password_resets_table作为範本
create_users_table档案需要更改如以下

<?phpuse Illuminate\Support\Facades\Schema;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 (Blueprint $table) {            **$table->increments('id');**原本为$table->ip() 现行版本不支援            $table->string('name');            $table->string('email')->unique();            $table->timestamp('email_verified_at')->nullable();            $table->string('password');            $table->rememberToken();            $table->timestamps();        });        //    }    /**     * Reverse the migrations.     *     * @return void     */    public function down()    {        Schema::dropIfExists('users');        //    }}

如果新增档案后想要删除档案

还没php artisan migrate

1.删除建立的档案
2.composer dump-autoload

如果已经执行 php artisan migrate

php artisan migrate:refresh

composer dump-autoload

删除database 里的table


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章