From ad6e7ea05454de0abd71cd1f7045a222bf2209c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=20=D0=9B=D0=B0=D1=80?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= Date: Mon, 25 Sep 2023 19:19:37 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=B0=D0=B2?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20=D0=B8=20?= =?UTF-8?q?=D1=80=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D0=B8?= =?UTF-8?q?=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1?= =?UTF-8?q?=82=D0=BE=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Admin/AdminController.php | 5 +++++ app/Models/User.php | 3 +++ resources/views/admin/login.blade.php | 10 +++++++++- resources/views/admin/register.blade.php | 14 +++++++++++--- resources/views/layouts/app.blade.php | 6 +++++- 5 files changed, 33 insertions(+), 5 deletions(-) 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')

- Авторизация + Авторизация в админке

@@ -98,4 +98,12 @@ Создание аккаунта

+

+ + Главная страница + +

@endsection diff --git a/resources/views/admin/register.blade.php b/resources/views/admin/register.blade.php index 75e2660..81b2abe 100644 --- a/resources/views/admin/register.blade.php +++ b/resources/views/admin/register.blade.php @@ -19,7 +19,7 @@

- Создание аккаунта + Создание аккаунта администратора

@csrf @@ -131,9 +131,17 @@

- Already have an account? Login + Авторизация в системе + +

+

+ + Главная страница

@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index aaa4bbf..5bfff24 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -45,7 +45,11 @@