public function store( Request $request)
{
$token = str_random(32);
$users = [
'name' => $request->name,
'email' => $request->email,
'password' => $request->password,
'user_token' => ($token),
];
/ Как сюда передать выбранные в форме
$device = Device::find('1');
dd($device);
$users = Sentinel::registerandActivate($users);
$users->devices()->attach($device);
public function postRegister(Request $request)
{
$token = str_random(32);
$users = [
'name' => request('name'),
'email' => request('email'),
'password' => request('password'),
'user_token' => ($token),
];
$users = Sentinel::registerandActivate($users,$devices);
$rolechosen = ($request->input('role'));
$admin_role = Sentinel::findRoleBySlug('admin');
$manager_role = Sentinel::findRoleBySlug('manager');
$user_role = Sentinel::findRoleBySlug('user');
if ($rolechosen == 'admin') {
$admin_role->users()->attach($users);
} elseif ($rolechosen == 'manager') {
$manager_role->users()->attach($users);
} elseif($rolechosen == 'user') {
$user_role->users()->attach($users);
}
return redirect('/profile');
}