-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: one package support multiple laravel version. #13
- Loading branch information
Showing
5 changed files
with
209 additions
and
18 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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">Social Login</div> | ||
|
||
<div class="panel-body text-center"> | ||
@if (in_array('wechat_web', $social_login_providers)) | ||
<script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script> | ||
<div class="card-text" id="login_container"></div> | ||
<script> | ||
var obj = new WxLogin({ | ||
self_redirect: false, | ||
id: "login_container", | ||
appid: "{{ config('services.wechat_web.client_id') }}", | ||
scope: "snsapi_login", | ||
redirect_uri: "{{ config('services.wechat_web.redirect') }}", | ||
state: "{{ csrf_token() }}", | ||
style: "", | ||
href: "" | ||
}); | ||
</script> | ||
@php | ||
unset($social_login_providers[array_search('wechat_web', $social_login_providers)]); | ||
@endphp | ||
@endif | ||
|
||
<ul class="list-inline"> | ||
@foreach ($social_login_providers as $provider) | ||
<li> | ||
<a class="nav-link btn {{ $errors->has(strtolower($provider)) ? 'btn-danger' : 'btn-primary' }}" href="/login/{{ strtolower($provider) }}" role="button">{{ __($provider) }}</a> | ||
</li> | ||
@endforeach | ||
</ul> | ||
</div> | ||
</div> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading">Login</div> | ||
|
||
<div class="panel-body"> | ||
<form class="form-horizontal" method="POST" action="{{ route('login') }}"> | ||
{{ csrf_field() }} | ||
|
||
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}"> | ||
<label for="email" class="col-md-4 control-label">E-Mail Address</label> | ||
|
||
<div class="col-md-6"> | ||
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required autofocus> | ||
|
||
@if ($errors->has('email')) | ||
<span class="help-block"> | ||
<strong>{{ $errors->first('email') }}</strong> | ||
</span> | ||
@endif | ||
</div> | ||
</div> | ||
|
||
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}"> | ||
<label for="password" class="col-md-4 control-label">Password</label> | ||
|
||
<div class="col-md-6"> | ||
<input id="password" type="password" class="form-control" name="password" required> | ||
|
||
@if ($errors->has('password')) | ||
<span class="help-block"> | ||
<strong>{{ $errors->first('password') }}</strong> | ||
</span> | ||
@endif | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="col-md-6 col-md-offset-4"> | ||
<div class="checkbox"> | ||
<label> | ||
<input type="checkbox" name="remember" {{ old('remember') ? 'checked' : '' }}> Remember Me | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="col-md-8 col-md-offset-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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
@extends('layouts.app') | ||
|
||
@section('content') | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2"> | ||
<div class="panel panel-default"> | ||
<div class="panel-heading">{{ __('Social Login') }}</div> | ||
|
||
<div class="panel-body"> | ||
<form method="POST" action="{{ route('profile.update') }}"> | ||
{{ csrf_field() }} | ||
{{ method_field('PUT') }} | ||
|
||
<div class="form-group row"> | ||
@if ($user->avatar) | ||
<label for="avatar" class="col-md-4 col-form-label text-right">{{ __('Avatar') }}</label> | ||
<div class="col-md-6"> | ||
<img class="img-thumbnail p-3" src="{{ $user->avatar }}" alt="{{ $user->name }} avatar"> | ||
</div> | ||
@endif | ||
|
||
<label for="name" class="col-md-4 col-form-label text-right">{{ __('Name') }}</label> | ||
|
||
<div class="col-md-6"> | ||
<input id="name" type="text" class="form-control{{ $errors->has('name') ? ' is-invalid' : '' }}" name="name" value="{{ old('name') ?: $user->name }}" required autofocus> | ||
|
||
@if ($errors->has('name')) | ||
<span class="invalid-feedback" role="alert"> | ||
<strong>{{ $errors->first('name') }}</strong> | ||
</span> | ||
@endif | ||
</div> | ||
</div> | ||
|
||
<div class="form-group row"> | ||
<label for="email" class="col-md-4 col-form-label text-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') ?: $user->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"> | ||
<div class="col-md-6 col-md-offset-4"> | ||
<button type="submit" class="btn btn-primary"> | ||
{{ __('Update') }} | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<div class="panel panel-default"> | ||
<div class="panel-heading">{{ __('Linked Accounts') }}</div> | ||
|
||
<div class="panel-body text-center"> | ||
<ul class="list-inline"> | ||
@foreach ($social_login_providers as $provider) | ||
<li> | ||
@if (in_array(strtolower($provider), $linked_providers)) | ||
<a class="btn btn-success disabled" href="#" role="button">{{ __($provider) }}</a> | ||
@else | ||
<a class="btn btn-primary" href="/login/{{ strtolower(str_replace('_', '-', $provider)) }}" role="button">{{ __($provider) }}</a> | ||
@endif | ||
</li> | ||
@endforeach | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
@endsection |