Support the ongoing development of Laravel.io →
Input Database Forms
Last updated 2 years ago.
0

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);
	}
Last updated 2 years ago.
0
                $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.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

shiva shiva Joined 24 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.