diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 495fd26..63add16 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -17,7 +17,7 @@ class UserController extends Controller public function store($request) { if (Auth::guest()) { - return redirect()->route('tasks.index'); + abort(403, 'Вы не авторизованы!'); } $validated = $request->validated(); @@ -35,4 +35,12 @@ class UserController extends Controller $message = __('controllers.tasks_create'); return redirect()->route('tasks.index'); } + + public function create() + { + if (Auth::guest()) { + abort(403, 'Вы не авторизованы!'); + } + return view('users.create'); + } } diff --git a/resources/views/users/create.blade.php b/resources/views/users/create.blade.php new file mode 100644 index 0000000..3347bdc --- /dev/null +++ b/resources/views/users/create.blade.php @@ -0,0 +1,50 @@ +@auth() +