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 @@