diff --git a/app/Http/Controllers/Admin/AdminController.php b/app/Http/Controllers/Admin/AdminController.php index a6691dc..e56f1c6 100644 --- a/app/Http/Controllers/Admin/AdminController.php +++ b/app/Http/Controllers/Admin/AdminController.php @@ -7,6 +7,7 @@ use App\Http\Requests\CompanyRequest; use App\Models\Company; use App\Models\Employer; use App\Models\User; +use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; @@ -42,6 +43,7 @@ class AdminController extends Controller 'required' => 'Укажите обязательное поле «:attribute»', 'confirmed' => 'Пароли не совпадают', 'email' => 'Введите корректный email', + 'unique' => 'Данный email занят уже', 'min' => [ 'string' => 'Поле «:attribute» должно быть не меньше :min символов', 'file' => 'Файл «:attribute» должен быть не меньше :min Кбайт' @@ -64,6 +66,9 @@ class AdminController extends Controller 'name' => $request->name, 'email' => $request->email, 'password' => Hash::make($request->password), + 'admin' => '1', + 'email_verified_at' => Carbon::now() + ]); return redirect() ->route('admin.login') diff --git a/app/Models/User.php b/app/Models/User.php index d12dbf4..da0b697 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -33,6 +33,9 @@ class User extends Authenticatable 'is_remove', 'is_ban', 'is_new', + 'email_verified_at', + 'created_at', + 'updated_at' ]; /** diff --git a/resources/views/admin/login.blade.php b/resources/views/admin/login.blade.php index 36853bf..6cc9eed 100644 --- a/resources/views/admin/login.blade.php +++ b/resources/views/admin/login.blade.php @@ -17,7 +17,7 @@ @section('content')