.container_12 .grid_6,
.container_16 .grid_8 {
width: 460px;
}
Это говорит: «Сделайте все .grid_6 внутри .container_12 и всех .grid_8 внутри .container_16 размером 460 пикселей». Таким образом, оба из них будут отображать одно и то же:
<div class="container_12">
<div class="grid_6">460px Wide</div>
</div>
<div class="container_16">
<div class="grid_8">460px Wide</div>
</div>
Что касается запятых, то он применяет одно правило к нескольким классам, например:
.blueCheese, .blueBike {
color:blue;
}
Он функционально эквивалентен :
.blueCheese { color:blue }
.blueBike { color:blue }
Но сокращает многословие.
Позвольте мне упростить ваш процесс:
Auth\registerController
protected function create(array $data)
{
$user = User::create([
'name' => $data['name'],
'lname' => $data['lname'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'u_type'=> $data['u_type'],
'token' => str_random(25),
'avatar'=> str_random(5),
'approved'=> $data['u_type'] == 'D' ? true: false
]);
}
. Одна вещь, которая, как я полагаю, должен быть такой: в своей базе данных установите столбец «одобрен» по умолчанию к false и не может быть недействительным. Еще одна вещь, которая может произойти, состоит в том, что у вас может не быть переменной «одобрено» в $fillable
в модели пользователя.
Ваша модель пользователя должна иметь что-то вроде этого:
$fillable = ['name','lname','email','password','u_type','token','avatar','approved'];
// $guarded = ['password']; or even $hidden = ['password']
< blockquote> https://laravel.com/docs/5.6/authentication#included-authenticating
LoginController
protected function authenticated(Request $request){
$user = User::where('email','=', $request->email)->first();
//There is no need to validate the token, unless you really want it to
if($user->approved) {
Auth::attempt($user);
//Or Auth::login($user);
return redirect()->back();
//Redirect back may redirect you to a place where you may not want it, depending on the url's that you hit previously when loading a page, a redirect to a certain url, usually home, is more effective
}
else{
//Token will be filled with a random string whenever the account is created, so validation if token is null is really needed.
//What you may need is to save information about if an email was or not sent to the user and if it did sent, it shows different errors.
return back()->with('info','Account not approved yet, please contact admin');
//No need to Auth::logout if he didn't managed to login. Either he's logged or he's not
}
}