mirror of
https://github.com/prurigro/hypothetical.git
synced 2024-11-09 11:16:39 -05:00
Implement basic registration and logging in/out
This commit is contained in:
parent
ae031fd488
commit
d9af664393
15 changed files with 145 additions and 13 deletions
|
@ -23,6 +23,11 @@ class AuthController extends Controller
|
|||
|
||||
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
|
||||
|
||||
/**
|
||||
* Page the user is redirected to after successfully registering
|
||||
*/
|
||||
protected $redirectPath = '/dashboard';
|
||||
|
||||
/**
|
||||
* Create a new authentication controller instance.
|
||||
*
|
||||
|
|
|
@ -2,15 +2,25 @@
|
|||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Routes
|
||||
| Public Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register all of the routes for an application.
|
||||
| It's a breeze. Simply tell Laravel the URIs it should respond to
|
||||
| and give it the controller to call when that URI is requested.
|
||||
|
|
||||
*/
|
||||
|
||||
Route::get('/', function () {
|
||||
return view('website.home');
|
||||
});
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Content Management Routes
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Authentication
|
||||
Route::get('auth/login', 'Auth\AuthController@getLogin');
|
||||
Route::post('auth/login', 'Auth\AuthController@postLogin');
|
||||
Route::get('auth/logout', 'Auth\AuthController@getLogout');
|
||||
|
||||
// Registration
|
||||
Route::get('auth/register', 'Auth\AuthController@getRegister');
|
||||
Route::post('auth/register', 'Auth\AuthController@postRegister');
|
||||
|
|
|
@ -148,6 +148,6 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'secure' => true,
|
||||
'secure' => false,
|
||||
|
||||
];
|
||||
|
|
4
resources/assets/less/app.less
vendored
4
resources/assets/less/app.less
vendored
|
@ -1,6 +1,8 @@
|
|||
@import "bootstrap";
|
||||
@import "var";
|
||||
@import "nav";
|
||||
@import "auth";
|
||||
|
||||
@import "elements/**";
|
||||
|
||||
/*
|
||||
|
|
||||
|
|
33
resources/assets/less/auth.less
vendored
Normal file
33
resources/assets/less/auth.less
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
.auth-container {
|
||||
form {
|
||||
margin-top: 50px;
|
||||
padding: 25px 25px 50px 25px;
|
||||
border-radius: 5px;
|
||||
border: 1px solid darken(@c_accent, 5%);
|
||||
background-color: @c_accent;
|
||||
|
||||
.form-field {
|
||||
label {
|
||||
float: left;
|
||||
min-width: 125px;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
button {
|
||||
position: absolute;
|
||||
right: 41px;
|
||||
bottom: 25px;
|
||||
}
|
||||
}
|
||||
}
|
3
resources/assets/less/elements/footer.less
vendored
Normal file
3
resources/assets/less/elements/footer.less
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
footer {
|
||||
|
||||
}
|
2
resources/assets/less/var.less
vendored
2
resources/assets/less/var.less
vendored
|
@ -5,3 +5,5 @@
|
|||
*/
|
||||
|
||||
@c_text: #111; // text colour
|
||||
@c_base: #0088cc; // base colour
|
||||
@c_accent: #f5f5f5; // accent colour
|
||||
|
|
11
resources/views/auth.blade.php
Normal file
11
resources/views/auth.blade.php
Normal file
|
@ -0,0 +1,11 @@
|
|||
@extends('base')
|
||||
|
||||
@section('page-content')
|
||||
<div class="container auth-container">
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-xs-push-3">
|
||||
@yield('auth-form')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
24
resources/views/auth/login.blade.php
Normal file
24
resources/views/auth/login.blade.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
@extends('auth')
|
||||
|
||||
@section('auth-form')
|
||||
<form method="POST" action="/auth/login">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="form-field">
|
||||
<label for="email">Email</label>
|
||||
<div class="input"><input type="email" name="email" value="{{ old('email') }}" /></div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="password">Password</label>
|
||||
<div class="input"><input type="password" name="password" id="password" /></div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="remember">Remember Me</label>
|
||||
<input type="checkbox" name="remember" />
|
||||
</div>
|
||||
|
||||
<button type="submit">Login</button>
|
||||
</form>
|
||||
@endsection
|
29
resources/views/auth/register.blade.php
Normal file
29
resources/views/auth/register.blade.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
@extends('auth')
|
||||
|
||||
@section('auth-form')
|
||||
<form method="POST" action="/auth/register">
|
||||
{!! csrf_field() !!}
|
||||
|
||||
<div class="form-field">
|
||||
<label for="name">Name</label>
|
||||
<div class="input"><input type="text" name="name" value="{{ old('name') }}" /></div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="email">Email</label>
|
||||
<div class="input"><input type="email" name="email" value="{{ old('email') }}" /></div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="password">Password</label>
|
||||
<div class="input"><input type="password" name="password" id="password" /></div>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="password_confirmation">Confirm</label>
|
||||
<div class="input"><input type="password" name="password_confirmation" id="password_confirmation" /></div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Register</button>
|
||||
</form>
|
||||
@endsection
|
|
@ -14,8 +14,9 @@
|
|||
@endif
|
||||
<link rel="stylesheet" href="{{ elixir('css/app.css') }}">
|
||||
</head>
|
||||
<body class="{{ Request::path() == "/" ? "index" : Request::path() }}">
|
||||
@include('elements.nav')
|
||||
@yield('page')
|
||||
<body class="{{ Request::path() == "/" ? "index" : preg_replace('/\//', '-', Request::path()) }}">
|
||||
@yield('page-top')
|
||||
@yield('page-content')
|
||||
@yield('page-bottom')
|
||||
</body>
|
||||
</html>
|
3
resources/views/elements/footer.blade.php
Normal file
3
resources/views/elements/footer.blade.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<footer>
|
||||
|
||||
</footer>
|
9
resources/views/public.blade.php
Normal file
9
resources/views/public.blade.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
@extends('base')
|
||||
|
||||
@section('page-top')
|
||||
@include('elements.nav')
|
||||
@endsection
|
||||
|
||||
@section('page-bottom')
|
||||
@include('elements.footer')
|
||||
@endsection
|
|
@ -1,6 +1,6 @@
|
|||
@extends('main')
|
||||
@extends('public')
|
||||
|
||||
@section('page')
|
||||
@section('page-content')
|
||||
|
||||
<div class="container">
|
||||
<div class="content">
|
||||
|
|
Loading…
Reference in a new issue