Hei, ich habe schon viele Antworten gesucht, aber konnte dieses Problem nicht lösen. HierLaravel 4 Illuminate Datenbank Eloquent MassAssignmentException Fehler
ist der Code für meine Migration
<?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');
}
}
Für Modell (Modelle/Activation.php)
<?php
class Activation extends Eloquent {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'activations';
protected $guarded = array();
}
Und ich rufe Aktivierungs Tabelle wie folgt.
Activation::create(['id' => 2, 'token' => 1231]);
Ernsthaft habe ich keine Ahnung, was hier falsch ist. Und ich bin ein Neuling bei Laravel 4. Hoffe, dass jemand mir beibringt, was passiert und wie man es löst.
Mögliche Duplikat [MassAssignmentException in Laravel] (http://stackoverflow.com/questions/22280136/massassignmentexception-in-laravel) –