Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Support for Username or Email with Laravel 5.7
- Loading branch information
Showing
13 changed files
with
487 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
<?php | |||
|
|||
namespace App\Http\Controllers; | |||
|
|||
use Illuminate\Http\Request; | |||
|
|||
class HomeController extends Controller | |||
{ | |||
/** | |||
* Create a new controller instance. | |||
* | |||
* @return void | |||
*/ | |||
public function __construct() | |||
{ | |||
$this->middleware('auth'); | |||
} | |||
|
|||
/** | |||
* Show the application dashboard. | |||
* | |||
* @return \Illuminate\Http\Response | |||
*/ | |||
public function index() | |||
{ | |||
return view('home'); | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,71 @@ | |||
@extends('layouts.app') | |||
|
|||
@section('content') | |||
<div class="container"> | |||
<div class="row justify-content-center"> | |||
<div class="col-md-8"> | |||
<div class="card"> | |||
<div class="card-header">{{ __('Login') }}</div> | |||
|
|||
<div class="card-body"> | |||
<form method="POST" action="{{ route('login') }}"> | |||
@csrf | |||
|
|||
<div class="form-group row"> | |||
<label for="email" class="col-sm-4 col-form-label text-md-right">{{ __('E-Mail Address / Username') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="email" type="text" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required autofocus> | |||
|
|||
@if ($errors->has('email')) | |||
<span class="invalid-feedback" role="alert"> | |||
<strong>{{ $errors->first('email') }}</strong> | |||
</span> | |||
@endif | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row"> | |||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required> | |||
|
|||
@if ($errors->has('password')) | |||
<span class="invalid-feedback" role="alert"> | |||
<strong>{{ $errors->first('password') }}</strong> | |||
</span> | |||
@endif | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row"> | |||
<div class="col-md-6 offset-md-4"> | |||
<div class="form-check"> | |||
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}> | |||
|
|||
<label class="form-check-label" for="remember"> | |||
{{ __('Remember Me') }} | |||
</label> | |||
</div> | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row mb-0"> | |||
<div class="col-md-8 offset-md-4"> | |||
<button type="submit" class="btn btn-primary"> | |||
{{ __('Login') }} | |||
</button> | |||
|
|||
<a class="btn btn-link" href="{{ route('password.request') }}"> | |||
{{ __('Forgot Your Password?') }} | |||
</a> | |||
</div> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,47 @@ | |||
@extends('layouts.app') | |||
|
|||
@section('content') | |||
<div class="container"> | |||
<div class="row justify-content-center"> | |||
<div class="col-md-8"> | |||
<div class="card"> | |||
<div class="card-header">{{ __('Reset Password') }}</div> | |||
|
|||
<div class="card-body"> | |||
@if (session('status')) | |||
<div class="alert alert-success" role="alert"> | |||
{{ session('status') }} | |||
</div> | |||
@endif | |||
|
|||
<form method="POST" action="{{ route('password.email') }}"> | |||
@csrf | |||
|
|||
<div class="form-group row"> | |||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ old('email') }}" required> | |||
|
|||
@if ($errors->has('email')) | |||
<span class="invalid-feedback" role="alert"> | |||
<strong>{{ $errors->first('email') }}</strong> | |||
</span> | |||
@endif | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row mb-0"> | |||
<div class="col-md-6 offset-md-4"> | |||
<button type="submit" class="btn btn-primary"> | |||
{{ __('Send Password Reset Link') }} | |||
</button> | |||
</div> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,65 @@ | |||
@extends('layouts.app') | |||
|
|||
@section('content') | |||
<div class="container"> | |||
<div class="row justify-content-center"> | |||
<div class="col-md-8"> | |||
<div class="card"> | |||
<div class="card-header">{{ __('Reset Password') }}</div> | |||
|
|||
<div class="card-body"> | |||
<form method="POST" action="{{ route('password.update') }}"> | |||
@csrf | |||
|
|||
<input type="hidden" name="token" value="{{ $token }}"> | |||
|
|||
<div class="form-group row"> | |||
<label for="email" class="col-md-4 col-form-label text-md-right">{{ __('E-Mail Address') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="email" type="email" class="form-control{{ $errors->has('email') ? ' is-invalid' : '' }}" name="email" value="{{ $email ?? old('email') }}" required autofocus> | |||
|
|||
@if ($errors->has('email')) | |||
<span class="invalid-feedback" role="alert"> | |||
<strong>{{ $errors->first('email') }}</strong> | |||
</span> | |||
@endif | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row"> | |||
<label for="password" class="col-md-4 col-form-label text-md-right">{{ __('Password') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="password" type="password" class="form-control{{ $errors->has('password') ? ' is-invalid' : '' }}" name="password" required> | |||
|
|||
@if ($errors->has('password')) | |||
<span class="invalid-feedback" role="alert"> | |||
<strong>{{ $errors->first('password') }}</strong> | |||
</span> | |||
@endif | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row"> | |||
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">{{ __('Confirm Password') }}</label> | |||
|
|||
<div class="col-md-6"> | |||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required> | |||
</div> | |||
</div> | |||
|
|||
<div class="form-group row mb-0"> | |||
<div class="col-md-6 offset-md-4"> | |||
<button type="submit" class="btn btn-primary"> | |||
{{ __('Reset Password') }} | |||
</button> | |||
</div> | |||
</div> | |||
</form> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@endsection |
Oops, something went wrong.
d0926d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for all contribute