当 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