From 828a54b5691329cd8c7fe16b71242dab5a7ad103 Mon Sep 17 00:00:00 2001 From: tfmm Date: Fri, 30 Mar 2018 08:08:32 -0400 Subject: [PATCH] Auth Setup --- app/Http/Controllers/HomeController.php | 28 +++++++ resources/views/auth/login.blade.php | 69 ++++++++++++++++ .../views/auth/passwords/email.blade.php | 47 +++++++++++ .../views/auth/passwords/reset.blade.php | 70 ++++++++++++++++ resources/views/auth/register.blade.php | 77 ++++++++++++++++++ resources/views/home.blade.php | 27 ++++--- resources/views/layouts/app.blade.php | 80 +++++++++++++++++++ routes/web.php | 4 + 8 files changed, 390 insertions(+), 12 deletions(-) create mode 100644 app/Http/Controllers/HomeController.php create mode 100644 resources/views/auth/login.blade.php create mode 100644 resources/views/auth/passwords/email.blade.php create mode 100644 resources/views/auth/passwords/reset.blade.php create mode 100644 resources/views/auth/register.blade.php create mode 100644 resources/views/layouts/app.blade.php diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php new file mode 100644 index 0000000..a3af7dd --- /dev/null +++ b/app/Http/Controllers/HomeController.php @@ -0,0 +1,28 @@ +middleware('auth'); + } + + /** + * Show the application dashboard. + * + * @return \Illuminate\Http\Response + */ + public function index() + { + return view('home'); + } +} diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php new file mode 100644 index 0000000..07924ce --- /dev/null +++ b/resources/views/auth/login.blade.php @@ -0,0 +1,69 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Login
+ +
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + Forgot Your Password? + +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php new file mode 100644 index 0000000..ad38245 --- /dev/null +++ b/resources/views/auth/passwords/email.blade.php @@ -0,0 +1,47 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Reset Password
+ +
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + +
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php new file mode 100644 index 0000000..84ec010 --- /dev/null +++ b/resources/views/auth/passwords/reset.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Reset Password
+ +
+
+ {{ csrf_field() }} + + + +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ +
+ + + @if ($errors->has('password_confirmation')) + + {{ $errors->first('password_confirmation') }} + + @endif +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php new file mode 100644 index 0000000..38eef83 --- /dev/null +++ b/resources/views/auth/register.blade.php @@ -0,0 +1,77 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
Register
+ +
+
+ {{ csrf_field() }} + +
+ + +
+ + + @if ($errors->has('name')) + + {{ $errors->first('name') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('email')) + + {{ $errors->first('email') }} + + @endif +
+
+ +
+ + +
+ + + @if ($errors->has('password')) + + {{ $errors->first('password') }} + + @endif +
+
+ +
+ + +
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
+@endsection diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 7906ee5..d8437bf 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -1,20 +1,23 @@ -@extends('layouts.master') +@extends('layouts.app') @section('content')
-
-
-
-
-

- Dashboard -

-
-
+
+
+
+
Dashboard
+
+ @if (session('status')) +
+ {{ session('status') }} +
+ @endif + + You are logged in! +
+
-
-
@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php new file mode 100644 index 0000000..f97a8a2 --- /dev/null +++ b/resources/views/layouts/app.blade.php @@ -0,0 +1,80 @@ + + + + + + + + + + + {{ config('app.name', 'Laravel') }} + + + + + +
+ + + @yield('content') +
+ + + + + diff --git a/routes/web.php b/routes/web.php index 9402110..7fd3ab9 100644 --- a/routes/web.php +++ b/routes/web.php @@ -27,3 +27,7 @@ Route::group(['middleware' => 'auth'], function() { Route::get('updaterecord', [ 'uses' => 'PagesController@updaterecord']); Route::post('updaterecord', [ 'uses' => 'PagesController@updaterecord']); }); + +Auth::routes(); + +Route::get('/home', 'HomeController@index')->name('home');