Got stuck in a issue with laravel 5.2.
Following is the error during eloquent create operation(post call),
Mass Assignment Exception in Model.php 453: column_name
Following are the prerequisites, which are to be taken into consideration:
- Fillables in model are filled in a dynamic manner by the following code:
public function __construct() { $this->fillable(\Schema::getColumnListing($this->getTable())) }
Following are the methods which are debugged till now:
Before insertion, in controller, $model::getillableField(), gives proper fillable array.
In model.php line(450),
if ($this->isFillable($key)) { $this->setAttribute($key, $value); }
the above code returns the value as "false" and $model::getFillableField() has the column_name in the array list.
Hardcoding $fillable variable with columns of table removes the error. Please Help, where i am going wrong and what is the solution for it?
Thanks in advance.