For some reason I can't edit my question, but I forgot to add my public function index of my controller
public function index()
{
setModuleSession("usersPermissions","");
$usersList = \User::all();
$group_options = \Groups::lists('name', 'id');
return \View::make('admin.usersPermissions.index', compact('usersList'))->with('group_options', $group_options);
}
$ignore = array('_token');
foreach ($_POST as $key => $value)
{
if(!in_array($key, $ignore ))
$user->{$key} = $value;
}
You said that you have a group_id in your input. All the input is taken and the '_token' removed. But you should also remove the group_id from the input.
$ignore = array('_token', 'group_id');
Eloquent doesn't know what column does your table have. It will try to insert all the properties you give to a model.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community