Skip to content

Mass Assignment

Carlos Rodrigues edited this page Jan 9, 2019 · 1 revision

Just like Laravel Eloquent, the create($array) and fill($array) methods can only receive attributes listed on getFillable() - whitelisted attributes.

  • getFillable() - by default returns the fields checked as 'form' on InterAdmin.

You can temporarily disable mass assignment protection when data is safe, on seeds or tests, for example:

\Jp7\Interadmin\Record::unguard();

Classe::create(['idade' => 12, 'nome' => 'teste']);

\Jp7\Interadmin\Record::reguard();
Clone this wiki locally