$role = \Model\Auth_Role::find($role_id);
foreach(Input::post('permission') as $perm_id => $actions)
{
$perm = \Model\Auth_Permission::find($perm_id);
$permission_array[] = \Model\Auth_Rolepermission::forge(
array(
'role_id' => $role->id,
'perms_id' => $perm->id,
'actions' => $actions,
));
$role->rolepermission = $permission_array;
$role->save();
}
id role_id perms_id actions
1 1 1 a:3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";}
id role_id perms_id actions
1 0 1 a:3:{i:0;s:1:"0";i:1;s:1:"1";i:2;s:1:"2";}
2 1 1 a:1:{i:0;s:1:"1";}
It looks like you're new here. If you want to get involved, click one of these buttons!