相关疑难解决方法(0)

Laravel 4 Illuminate\Database\Eloquent\MassAssignmentException错误

嘿,我已经搜索了很多答案,但无法解决这个问题.

这是我迁移的代码

<?php

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

class CreateActiveTable extends Migration {

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activations', function($table)
        {
            $table->bigInteger('id')->primary();
            $table->tinyInteger('token');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('activations');
    }
}
Run Code Online (Sandbox Code Playgroud)

对于型号(型号/ Activation.php)

<?php

class Activation extends Eloquent {

    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'activations';
    protected $guarded …
Run Code Online (Sandbox Code Playgroud)

php laravel eloquent laravel-4

9
推荐指数
1
解决办法
9359
查看次数

标签 统计

eloquent ×1

laravel ×1

laravel-4 ×1

php ×1