upgraded dependencies
This commit is contained in:
125
vendor/laravel/ui/CHANGELOG.md
vendored
Normal file
125
vendor/laravel/ui/CHANGELOG.md
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
# Release Notes
|
||||
|
||||
## [Unreleased](https://github.com/laravel/ui/compare/v2.5.0...2.x)
|
||||
|
||||
|
||||
## [v2.5.0 (2020-11-03)](https://github.com/laravel/ui/compare/v2.4.1...v2.5.0)
|
||||
|
||||
### Added
|
||||
- PHP 8 Support ([#179](https://github.com/laravel/ui/pull/179))
|
||||
|
||||
|
||||
## [v2.4.1 (2020-09-22)](https://github.com/laravel/ui/compare/v2.4.0...v2.4.1)
|
||||
|
||||
### Changed
|
||||
- Revert "Add namespace check to Auth routes" ([#160](https://github.com/laravel/ui/pull/160))
|
||||
|
||||
|
||||
## [v2.4.0 (2020-09-11)](https://github.com/laravel/ui/compare/v2.3.0...v2.4.0)
|
||||
|
||||
### Removed
|
||||
- Remove Laravel 8 support ([#154](https://github.com/laravel/ui/pull/154))
|
||||
|
||||
### Fixed
|
||||
- Fix Bootstrap preset ([#146](https://github.com/laravel/ui/pull/146))
|
||||
|
||||
|
||||
## [v2.3.0 (2020-09-09)](https://github.com/laravel/ui/compare/v2.2.1...v2.3.0)
|
||||
|
||||
### Fixed
|
||||
- Add namespace check to Auth routes ([#143](https://github.com/laravel/ui/pull/143))
|
||||
|
||||
|
||||
## [v2.2.1 (2020-09-08)](https://github.com/laravel/ui/compare/v2.2.0...v2.2.1)
|
||||
|
||||
### Fixed
|
||||
- Use proper json responses ([#139](https://github.com/laravel/ui/pull/139))
|
||||
- Ensure sass directory exists ([456daa3](https://github.com/laravel/ui/commit/456daa330a32483b0fa9794334e60af6b2db3bf6))
|
||||
|
||||
|
||||
## [v2.2.0 (2020-08-25)](https://github.com/laravel/ui/compare/v2.1.0...v2.2.0)
|
||||
|
||||
### Added
|
||||
- Laravel 8 support ([4a0db5b](https://github.com/laravel/ui/commit/4a0db5b2e5d3c032b0f213e847008d39c8c7ce45))
|
||||
|
||||
### Fixed
|
||||
- Remove caret and replace `display: none` with `d-none` ([#135](https://github.com/laravel/ui/pull/135))
|
||||
|
||||
|
||||
## [v2.1.0 (2020-06-30)](https://github.com/laravel/ui/compare/v2.0.3...v2.1.0)
|
||||
|
||||
### Added
|
||||
- Allow for optional login and logout routes ([#113](https://github.com/laravel/ui/pull/113))
|
||||
|
||||
### Fixed
|
||||
- Missed localizable strings ([#105](https://github.com/laravel/ui/pull/105))
|
||||
|
||||
|
||||
## [v2.0.3 (2020-04-29)](https://github.com/laravel/ui/compare/v2.0.2...v2.0.3)
|
||||
|
||||
### Fixed
|
||||
- Fix confirm controller overwrite ([#100](https://github.com/laravel/ui/pull/100))
|
||||
|
||||
|
||||
## [v2.0.2 (2020-04-28)](https://github.com/laravel/ui/compare/v2.0.1...v2.0.2)
|
||||
|
||||
### Fixed
|
||||
- Confirm controller overwrite ([#95](https://github.com/laravel/ui/pull/95))
|
||||
|
||||
|
||||
## [v2.0.1 (2020-03-03)](https://github.com/laravel/ui/compare/v2.0.0...v2.0.1)
|
||||
|
||||
### Fixed
|
||||
- Make `auth` options empty by default ([47a0a1d](https://github.com/laravel/ui/commit/47a0a1dac76f5e73803c86e1f38b2c7e0ae7fa83))
|
||||
|
||||
|
||||
## [v2.0.0 (2020-03-03)](https://github.com/laravel/ui/compare/v1.2.0...v2.0.0)
|
||||
|
||||
### Changed
|
||||
- The UI package now contains all auth scaffolding from the laravel skeleton
|
||||
|
||||
|
||||
## [v1.2.0 (2020-02-18)](https://github.com/laravel/ui/compare/v1.1.2...v1.2.0)
|
||||
|
||||
### Changed
|
||||
- Use `sass-loader` v8 for Vue preset ([bb64fca](https://github.com/laravel/ui/commit/bb64fca681566ca94457d490a00f899516e75664))
|
||||
|
||||
|
||||
## [v1.1.2 (2019-10-20)](https://github.com/laravel/ui/compare/v1.1.1...v1.1.2)
|
||||
|
||||
### Changed
|
||||
- Removed Laravel 7.0 support ([0287d4ee](https://github.com/laravel/ui/commit/0287d4eee80aad718bdf7f90117cfe720c493064))
|
||||
|
||||
|
||||
## [v1.1.1 (2019-10-11)](https://github.com/laravel/ui/compare/v1.1.0...v1.1.1)
|
||||
|
||||
### Changed
|
||||
- Change the specified time until re-authentication ([#37](https://github.com/laravel/ui/pull/37))
|
||||
|
||||
### Fixed
|
||||
- Add `auth.passwords.confirm` to exported views ([#36](https://github.com/laravel/ui/pull/36))
|
||||
|
||||
|
||||
## [v1.1.0 (2019-10-08)](https://github.com/laravel/ui/compare/v1.0.1...v1.1.0)
|
||||
|
||||
### Added
|
||||
- Add password confirmation screen ([#34](https://github.com/laravel/ui/pull/34))
|
||||
|
||||
### Changed
|
||||
- Remove X-CSRF-TOKEN header from Axios instance ([#23](https://github.com/laravel/ui/pull/23))
|
||||
|
||||
### Fixed
|
||||
- Replace tab to space ([#28](https://github.com/laravel/ui/pull/28))
|
||||
- Add missing semicolon to avoid unnecessary diff ([#32](https://github.com/laravel/ui/pull/32))
|
||||
- Update resolve-url-loader dependency constraint ([#33](https://github.com/laravel/ui/pull/33))
|
||||
|
||||
|
||||
## [v1.0.1 (2019-09-02)](https://github.com/laravel/ui/compare/v1.0.0...v1.0.1)
|
||||
|
||||
### Added
|
||||
- Add macro check on ui:auth command ([#16](https://github.com/laravel/ui/pull/16))
|
||||
|
||||
|
||||
## v1.0.0 (2019-08-13)
|
||||
|
||||
Initial commit.
|
21
vendor/laravel/ui/LICENSE.md
vendored
Normal file
21
vendor/laravel/ui/LICENSE.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Taylor Otwell
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
33
vendor/laravel/ui/README.md
vendored
Normal file
33
vendor/laravel/ui/README.md
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
# Laravel UI
|
||||
|
||||
<a href="https://packagist.org/packages/laravel/ui"><img src="https://poser.pugx.org/laravel/ui/d/total.svg" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/ui"><img src="https://poser.pugx.org/laravel/ui/v/stable.svg" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/ui"><img src="https://poser.pugx.org/laravel/ui/license.svg" alt="License"></a>
|
||||
|
||||
## Introduction
|
||||
|
||||
### This project should no longer be used on new Laravel projects. Please use [Laravel Jetstream](https://github.com/laravel/jetstream) instead.
|
||||
|
||||
While Laravel does not dictate which JavaScript or CSS pre-processors you use, it does provide a basic starting point using [Bootstrap](https://getbootstrap.com/), [React](https://reactjs.org/), and / or [Vue](https://vuejs.org/) that will be helpful for many applications. By default, Laravel uses [NPM](https://www.npmjs.org/) to install both of these frontend packages.
|
||||
|
||||
**We are not accepting new presets.**
|
||||
|
||||
## Official Documentation
|
||||
|
||||
Documentation can be found on the [Laravel website](https://laravel.com/docs/frontend).
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to UI! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
Please review [our security policy](https://github.com/laravel/ui/security/policy) on how to report security vulnerabilities.
|
||||
|
||||
## License
|
||||
|
||||
Laravel UI is open-sourced software licensed under the [MIT license](LICENSE.md).
|
199
vendor/laravel/ui/auth-backend/AuthenticatesUsers.php
vendored
Normal file
199
vendor/laravel/ui/auth-backend/AuthenticatesUsers.php
vendored
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
trait AuthenticatesUsers
|
||||
{
|
||||
use RedirectsUsers, ThrottlesLogins;
|
||||
|
||||
/**
|
||||
* Show the application's login form.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showLoginForm()
|
||||
{
|
||||
return view('auth.login');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a login request to the application.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
public function login(Request $request)
|
||||
{
|
||||
$this->validateLogin($request);
|
||||
|
||||
// If the class is using the ThrottlesLogins trait, we can automatically throttle
|
||||
// the login attempts for this application. We'll key this by the username and
|
||||
// the IP address of the client making these requests into this application.
|
||||
if (method_exists($this, 'hasTooManyLoginAttempts') &&
|
||||
$this->hasTooManyLoginAttempts($request)) {
|
||||
$this->fireLockoutEvent($request);
|
||||
|
||||
return $this->sendLockoutResponse($request);
|
||||
}
|
||||
|
||||
if ($this->attemptLogin($request)) {
|
||||
return $this->sendLoginResponse($request);
|
||||
}
|
||||
|
||||
// If the login attempt was unsuccessful we will increment the number of attempts
|
||||
// to login and redirect the user back to the login form. Of course, when this
|
||||
// user surpasses their maximum number of attempts they will get locked out.
|
||||
$this->incrementLoginAttempts($request);
|
||||
|
||||
return $this->sendFailedLoginResponse($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the user login request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
protected function validateLogin(Request $request)
|
||||
{
|
||||
$request->validate([
|
||||
$this->username() => 'required|string',
|
||||
'password' => 'required|string',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to log the user into the application.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return bool
|
||||
*/
|
||||
protected function attemptLogin(Request $request)
|
||||
{
|
||||
return $this->guard()->attempt(
|
||||
$this->credentials($request), $request->filled('remember')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the needed authorization credentials from the request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
protected function credentials(Request $request)
|
||||
{
|
||||
return $request->only($this->username(), 'password');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the response after the user was authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function sendLoginResponse(Request $request)
|
||||
{
|
||||
$request->session()->regenerate();
|
||||
|
||||
$this->clearLoginAttempts($request);
|
||||
|
||||
if ($response = $this->authenticated($request, $this->guard()->user())) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect()->intended($this->redirectPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* The user has been authenticated.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param mixed $user
|
||||
* @return mixed
|
||||
*/
|
||||
protected function authenticated(Request $request, $user)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the failed login response instance.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
protected function sendFailedLoginResponse(Request $request)
|
||||
{
|
||||
throw ValidationException::withMessages([
|
||||
$this->username() => [trans('auth.failed')],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the login username to be used by the controller.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function username()
|
||||
{
|
||||
return 'email';
|
||||
}
|
||||
|
||||
/**
|
||||
* Log the user out of the application.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function logout(Request $request)
|
||||
{
|
||||
$this->guard()->logout();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
$request->session()->regenerateToken();
|
||||
|
||||
if ($response = $this->loggedOut($request)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect('/');
|
||||
}
|
||||
|
||||
/**
|
||||
* The user has logged out of the application.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
protected function loggedOut(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the guard to be used during authentication.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Auth\StatefulGuard
|
||||
*/
|
||||
protected function guard()
|
||||
{
|
||||
return Auth::guard();
|
||||
}
|
||||
}
|
71
vendor/laravel/ui/auth-backend/ConfirmsPasswords.php
vendored
Normal file
71
vendor/laravel/ui/auth-backend/ConfirmsPasswords.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
trait ConfirmsPasswords
|
||||
{
|
||||
use RedirectsUsers;
|
||||
|
||||
/**
|
||||
* Display the password confirmation view.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showConfirmForm()
|
||||
{
|
||||
return view('auth.passwords.confirm');
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm the given user's password.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function confirm(Request $request)
|
||||
{
|
||||
$request->validate($this->rules(), $this->validationErrorMessages());
|
||||
|
||||
$this->resetPasswordConfirmationTimeout($request);
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect()->intended($this->redirectPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the password confirmation timeout.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
protected function resetPasswordConfirmationTimeout(Request $request)
|
||||
{
|
||||
$request->session()->put('auth.password_confirmed_at', time());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password confirmation validation rules.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'password' => 'required|password',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password confirmation validation error messages.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function validationErrorMessages()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
20
vendor/laravel/ui/auth-backend/RedirectsUsers.php
vendored
Normal file
20
vendor/laravel/ui/auth-backend/RedirectsUsers.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
trait RedirectsUsers
|
||||
{
|
||||
/**
|
||||
* Get the post register / login redirect path.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function redirectPath()
|
||||
{
|
||||
if (method_exists($this, 'redirectTo')) {
|
||||
return $this->redirectTo();
|
||||
}
|
||||
|
||||
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
|
||||
}
|
||||
}
|
68
vendor/laravel/ui/auth-backend/RegistersUsers.php
vendored
Normal file
68
vendor/laravel/ui/auth-backend/RegistersUsers.php
vendored
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
trait RegistersUsers
|
||||
{
|
||||
use RedirectsUsers;
|
||||
|
||||
/**
|
||||
* Show the application registration form.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showRegistrationForm()
|
||||
{
|
||||
return view('auth.register');
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle a registration request for the application.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function register(Request $request)
|
||||
{
|
||||
$this->validator($request->all())->validate();
|
||||
|
||||
event(new Registered($user = $this->create($request->all())));
|
||||
|
||||
$this->guard()->login($user);
|
||||
|
||||
if ($response = $this->registered($request, $user)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 201)
|
||||
: redirect($this->redirectPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the guard to be used during registration.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Auth\StatefulGuard
|
||||
*/
|
||||
protected function guard()
|
||||
{
|
||||
return Auth::guard();
|
||||
}
|
||||
|
||||
/**
|
||||
* The user has been registered.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param mixed $user
|
||||
* @return mixed
|
||||
*/
|
||||
protected function registered(Request $request, $user)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
186
vendor/laravel/ui/auth-backend/ResetsPasswords.php
vendored
Normal file
186
vendor/laravel/ui/auth-backend/ResetsPasswords.php
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Auth\Events\PasswordReset;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
trait ResetsPasswords
|
||||
{
|
||||
use RedirectsUsers;
|
||||
|
||||
/**
|
||||
* Display the password reset view for the given token.
|
||||
*
|
||||
* If no token is present, display the link request form.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string|null $token
|
||||
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||
*/
|
||||
public function showResetForm(Request $request, $token = null)
|
||||
{
|
||||
return view('auth.passwords.reset')->with(
|
||||
['token' => $token, 'email' => $request->email]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the given user's password.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function reset(Request $request)
|
||||
{
|
||||
$request->validate($this->rules(), $this->validationErrorMessages());
|
||||
|
||||
// Here we will attempt to reset the user's password. If it is successful we
|
||||
// will update the password on an actual user model and persist it to the
|
||||
// database. Otherwise we will parse the error and return the response.
|
||||
$response = $this->broker()->reset(
|
||||
$this->credentials($request), function ($user, $password) {
|
||||
$this->resetPassword($user, $password);
|
||||
}
|
||||
);
|
||||
|
||||
// If the password was successfully reset, we will redirect the user back to
|
||||
// the application's home authenticated view. If there is an error we can
|
||||
// redirect them back to where they came from with their error message.
|
||||
return $response == Password::PASSWORD_RESET
|
||||
? $this->sendResetResponse($request, $response)
|
||||
: $this->sendResetFailedResponse($request, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password reset validation rules.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
'token' => 'required',
|
||||
'email' => 'required|email',
|
||||
'password' => 'required|confirmed|min:8',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password reset validation error messages.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function validationErrorMessages()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the password reset credentials from the request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
protected function credentials(Request $request)
|
||||
{
|
||||
return $request->only(
|
||||
'email', 'password', 'password_confirmation', 'token'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the given user's password.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\CanResetPassword $user
|
||||
* @param string $password
|
||||
* @return void
|
||||
*/
|
||||
protected function resetPassword($user, $password)
|
||||
{
|
||||
$this->setUserPassword($user, $password);
|
||||
|
||||
$user->setRememberToken(Str::random(60));
|
||||
|
||||
$user->save();
|
||||
|
||||
event(new PasswordReset($user));
|
||||
|
||||
$this->guard()->login($user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the user's password.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Auth\CanResetPassword $user
|
||||
* @param string $password
|
||||
* @return void
|
||||
*/
|
||||
protected function setUserPassword($user, $password)
|
||||
{
|
||||
$user->password = Hash::make($password);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response for a successful password reset.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $response
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function sendResetResponse(Request $request, $response)
|
||||
{
|
||||
if ($request->wantsJson()) {
|
||||
return new JsonResponse(['message' => trans($response)], 200);
|
||||
}
|
||||
|
||||
return redirect($this->redirectPath())
|
||||
->with('status', trans($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response for a failed password reset.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $response
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function sendResetFailedResponse(Request $request, $response)
|
||||
{
|
||||
if ($request->wantsJson()) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => [trans($response)],
|
||||
]);
|
||||
}
|
||||
|
||||
return redirect()->back()
|
||||
->withInput($request->only('email'))
|
||||
->withErrors(['email' => trans($response)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the broker to be used during password reset.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Auth\PasswordBroker
|
||||
*/
|
||||
public function broker()
|
||||
{
|
||||
return Password::broker();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the guard to be used during password reset.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Auth\StatefulGuard
|
||||
*/
|
||||
protected function guard()
|
||||
{
|
||||
return Auth::guard();
|
||||
}
|
||||
}
|
111
vendor/laravel/ui/auth-backend/SendsPasswordResetEmails.php
vendored
Normal file
111
vendor/laravel/ui/auth-backend/SendsPasswordResetEmails.php
vendored
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Password;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
trait SendsPasswordResetEmails
|
||||
{
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
* @return \Illuminate\View\View
|
||||
*/
|
||||
public function showLinkRequestForm()
|
||||
{
|
||||
return view('auth.passwords.email');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a reset link to the given user.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
public function sendResetLinkEmail(Request $request)
|
||||
{
|
||||
$this->validateEmail($request);
|
||||
|
||||
// We will send the password reset link to this user. Once we have attempted
|
||||
// to send the link, we will examine the response then see the message we
|
||||
// need to show to the user. Finally, we'll send out a proper response.
|
||||
$response = $this->broker()->sendResetLink(
|
||||
$this->credentials($request)
|
||||
);
|
||||
|
||||
return $response == Password::RESET_LINK_SENT
|
||||
? $this->sendResetLinkResponse($request, $response)
|
||||
: $this->sendResetLinkFailedResponse($request, $response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate the email for the given request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
protected function validateEmail(Request $request)
|
||||
{
|
||||
$request->validate(['email' => 'required|email']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the needed authentication credentials from the request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
protected function credentials(Request $request)
|
||||
{
|
||||
return $request->only('email');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response for a successful password reset link.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $response
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
|
||||
*/
|
||||
protected function sendResetLinkResponse(Request $request, $response)
|
||||
{
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse(['message' => trans($response)], 200)
|
||||
: back()->with('status', trans($response));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the response for a failed password reset link.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param string $response
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
protected function sendResetLinkFailedResponse(Request $request, $response)
|
||||
{
|
||||
if ($request->wantsJson()) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => [trans($response)],
|
||||
]);
|
||||
}
|
||||
|
||||
return back()
|
||||
->withInput($request->only('email'))
|
||||
->withErrors(['email' => trans($response)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the broker to be used during password reset.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Auth\PasswordBroker
|
||||
*/
|
||||
public function broker()
|
||||
{
|
||||
return Password::broker();
|
||||
}
|
||||
}
|
125
vendor/laravel/ui/auth-backend/ThrottlesLogins.php
vendored
Normal file
125
vendor/laravel/ui/auth-backend/ThrottlesLogins.php
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Auth\Events\Lockout;
|
||||
use Illuminate\Cache\RateLimiter;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
trait ThrottlesLogins
|
||||
{
|
||||
/**
|
||||
* Determine if the user has too many failed login attempts.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return bool
|
||||
*/
|
||||
protected function hasTooManyLoginAttempts(Request $request)
|
||||
{
|
||||
return $this->limiter()->tooManyAttempts(
|
||||
$this->throttleKey($request), $this->maxAttempts()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment the login attempts for the user.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
protected function incrementLoginAttempts(Request $request)
|
||||
{
|
||||
$this->limiter()->hit(
|
||||
$this->throttleKey($request), $this->decayMinutes() * 60
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect the user after determining they are locked out.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*
|
||||
* @throws \Illuminate\Validation\ValidationException
|
||||
*/
|
||||
protected function sendLockoutResponse(Request $request)
|
||||
{
|
||||
$seconds = $this->limiter()->availableIn(
|
||||
$this->throttleKey($request)
|
||||
);
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
$this->username() => [Lang::get('auth.throttle', [
|
||||
'seconds' => $seconds,
|
||||
'minutes' => ceil($seconds / 60),
|
||||
])],
|
||||
])->status(Response::HTTP_TOO_MANY_REQUESTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the login locks for the given user credentials.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
protected function clearLoginAttempts(Request $request)
|
||||
{
|
||||
$this->limiter()->clear($this->throttleKey($request));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fire an event when a lockout occurs.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return void
|
||||
*/
|
||||
protected function fireLockoutEvent(Request $request)
|
||||
{
|
||||
event(new Lockout($request));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the throttle key for the given request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return string
|
||||
*/
|
||||
protected function throttleKey(Request $request)
|
||||
{
|
||||
return Str::lower($request->input($this->username())).'|'.$request->ip();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rate limiter instance.
|
||||
*
|
||||
* @return \Illuminate\Cache\RateLimiter
|
||||
*/
|
||||
protected function limiter()
|
||||
{
|
||||
return app(RateLimiter::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum number of attempts to allow.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function maxAttempts()
|
||||
{
|
||||
return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of minutes to throttle for.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function decayMinutes()
|
||||
{
|
||||
return property_exists($this, 'decayMinutes') ? $this->decayMinutes : 1;
|
||||
}
|
||||
}
|
95
vendor/laravel/ui/auth-backend/VerifiesEmails.php
vendored
Normal file
95
vendor/laravel/ui/auth-backend/VerifiesEmails.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
|
||||
namespace Illuminate\Foundation\Auth;
|
||||
|
||||
use Illuminate\Auth\Access\AuthorizationException;
|
||||
use Illuminate\Auth\Events\Verified;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
trait VerifiesEmails
|
||||
{
|
||||
use RedirectsUsers;
|
||||
|
||||
/**
|
||||
* Show the email verification notice.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\View\View
|
||||
*/
|
||||
public function show(Request $request)
|
||||
{
|
||||
return $request->user()->hasVerifiedEmail()
|
||||
? redirect($this->redirectPath())
|
||||
: view('auth.verify');
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark the authenticated user's email address as verified.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
|
||||
*
|
||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
||||
*/
|
||||
public function verify(Request $request)
|
||||
{
|
||||
if (! hash_equals((string) $request->route('id'), (string) $request->user()->getKey())) {
|
||||
throw new AuthorizationException;
|
||||
}
|
||||
|
||||
if (! hash_equals((string) $request->route('hash'), sha1($request->user()->getEmailForVerification()))) {
|
||||
throw new AuthorizationException;
|
||||
}
|
||||
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect($this->redirectPath());
|
||||
}
|
||||
|
||||
if ($request->user()->markEmailAsVerified()) {
|
||||
event(new Verified($request->user()));
|
||||
}
|
||||
|
||||
if ($response = $this->verified($request)) {
|
||||
return $response;
|
||||
}
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect($this->redirectPath())->with('verified', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* The user has been verified.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
protected function verified(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Resend the email verification notification.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function resend(Request $request)
|
||||
{
|
||||
if ($request->user()->hasVerifiedEmail()) {
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 204)
|
||||
: redirect($this->redirectPath());
|
||||
}
|
||||
|
||||
$request->user()->sendEmailVerificationNotification();
|
||||
|
||||
return $request->wantsJson()
|
||||
? new JsonResponse([], 202)
|
||||
: back()->with('resent', true);
|
||||
}
|
||||
}
|
36
vendor/laravel/ui/composer.json
vendored
Normal file
36
vendor/laravel/ui/composer.json
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "laravel/ui",
|
||||
"description": "Laravel UI utilities and presets.",
|
||||
"keywords": ["laravel", "ui"],
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.2.5|^8.0",
|
||||
"illuminate/console": "^7.0",
|
||||
"illuminate/filesystem": "^7.0",
|
||||
"illuminate/support": "^7.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Ui\\": "src/",
|
||||
"Illuminate\\Foundation\\Auth\\": "auth-backend/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Ui\\UiServiceProvider"
|
||||
]
|
||||
}
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
73
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/login.stub
vendored
Normal file
73
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/login.stub
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
@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-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 @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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 @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
49
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/confirm.stub
vendored
Normal file
49
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/confirm.stub
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
@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">{{ __('Confirm Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ __('Please confirm your password before continuing.') }}
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}">
|
||||
@csrf
|
||||
|
||||
<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 @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Confirm Password') }}
|
||||
</button>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
47
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/email.stub
vendored
Normal file
47
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/email.stub
vendored
Normal file
@@ -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 @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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
|
65
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/reset.stub
vendored
Normal file
65
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/passwords/reset.stub
vendored
Normal file
@@ -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 @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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 @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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 autocomplete="new-password">
|
||||
</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
|
77
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/register.stub
vendored
Normal file
77
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/register.stub
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
@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">{{ __('Register') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('register') }}">
|
||||
@csrf
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="name" class="col-md-4 col-form-label text-md-right">{{ __('Name') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
|
||||
|
||||
@error('name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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 @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</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 autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
28
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/verify.stub
vendored
Normal file
28
vendor/laravel/ui/src/Auth/bootstrap-stubs/auth/verify.stub
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
@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">{{ __('Verify Your Email Address') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }},
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
vendor/laravel/ui/src/Auth/bootstrap-stubs/home.stub
vendored
Normal file
23
vendor/laravel/ui/src/Auth/bootstrap-stubs/home.stub
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
@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">{{ __('Dashboard') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('You are logged in!') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
80
vendor/laravel/ui/src/Auth/bootstrap-stubs/layouts/app.stub
vendored
Normal file
80
vendor/laravel/ui/src/Auth/bootstrap-stubs/layouts/app.stub
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Scripts -->
|
||||
<script src="{{ asset('js/app.js') }}" defer></script>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
|
||||
|
||||
<!-- Styles -->
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="navbar-nav mr-auto">
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
||||
</li>
|
||||
@if (Route::has('register'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->name }}
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="py-4">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
28
vendor/laravel/ui/src/Auth/stubs/controllers/HomeController.stub
vendored
Normal file
28
vendor/laravel/ui/src/Auth/stubs/controllers/HomeController.stub
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace {{namespace}}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\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
4
vendor/laravel/ui/src/Auth/stubs/routes.stub
vendored
Normal file
4
vendor/laravel/ui/src/Auth/stubs/routes.stub
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
Auth::routes();
|
||||
|
||||
Route::get('/home', 'HomeController@index')->name('home');
|
164
vendor/laravel/ui/src/AuthCommand.php
vendored
Normal file
164
vendor/laravel/ui/src/AuthCommand.php
vendored
Normal file
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class AuthCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ui:auth
|
||||
{ type=bootstrap : The preset type (bootstrap) }
|
||||
{--views : Only scaffold the authentication views}
|
||||
{--force : Overwrite existing views by default}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Scaffold basic login and registration views and routes';
|
||||
|
||||
/**
|
||||
* The views that need to be exported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $views = [
|
||||
'auth/login.stub' => 'auth/login.blade.php',
|
||||
'auth/passwords/confirm.stub' => 'auth/passwords/confirm.blade.php',
|
||||
'auth/passwords/email.stub' => 'auth/passwords/email.blade.php',
|
||||
'auth/passwords/reset.stub' => 'auth/passwords/reset.blade.php',
|
||||
'auth/register.stub' => 'auth/register.blade.php',
|
||||
'auth/verify.stub' => 'auth/verify.blade.php',
|
||||
'home.stub' => 'home.blade.php',
|
||||
'layouts/app.stub' => 'layouts/app.blade.php',
|
||||
];
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (static::hasMacro($this->argument('type'))) {
|
||||
return call_user_func(static::$macros[$this->argument('type')], $this);
|
||||
}
|
||||
|
||||
if (! in_array($this->argument('type'), ['bootstrap'])) {
|
||||
throw new InvalidArgumentException('Invalid preset.');
|
||||
}
|
||||
|
||||
$this->ensureDirectoriesExist();
|
||||
$this->exportViews();
|
||||
|
||||
if (! $this->option('views')) {
|
||||
$this->exportBackend();
|
||||
}
|
||||
|
||||
$this->info('Authentication scaffolding generated successfully.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the directories for the files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function ensureDirectoriesExist()
|
||||
{
|
||||
if (! is_dir($directory = $this->getViewPath('layouts'))) {
|
||||
mkdir($directory, 0755, true);
|
||||
}
|
||||
|
||||
if (! is_dir($directory = $this->getViewPath('auth/passwords'))) {
|
||||
mkdir($directory, 0755, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the authentication views.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function exportViews()
|
||||
{
|
||||
foreach ($this->views as $key => $value) {
|
||||
if (file_exists($view = $this->getViewPath($value)) && ! $this->option('force')) {
|
||||
if (! $this->confirm("The [{$value}] view already exists. Do you want to replace it?")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
copy(
|
||||
__DIR__.'/Auth/'.$this->argument('type').'-stubs/'.$key,
|
||||
$view
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export the authentication backend.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function exportBackend()
|
||||
{
|
||||
$this->callSilent('ui:controllers');
|
||||
|
||||
$controller = app_path('Http/Controllers/HomeController.php');
|
||||
|
||||
if (file_exists($controller) && ! $this->option('force')) {
|
||||
if ($this->confirm("The [HomeController.php] file already exists. Do you want to replace it?")) {
|
||||
file_put_contents($controller, $this->compileControllerStub());
|
||||
}
|
||||
} else {
|
||||
file_put_contents($controller, $this->compileControllerStub());
|
||||
}
|
||||
|
||||
file_put_contents(
|
||||
base_path('routes/web.php'),
|
||||
file_get_contents(__DIR__.'/Auth/stubs/routes.stub'),
|
||||
FILE_APPEND
|
||||
);
|
||||
|
||||
copy(
|
||||
__DIR__.'/../stubs/migrations/2014_10_12_100000_create_password_resets_table.php',
|
||||
base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compiles the "HomeController" stub.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
protected function compileControllerStub()
|
||||
{
|
||||
return str_replace(
|
||||
'{{namespace}}',
|
||||
$this->laravel->getNamespace(),
|
||||
file_get_contents(__DIR__.'/Auth/stubs/controllers/HomeController.stub')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get full view path relative to the application's configured view path.
|
||||
*
|
||||
* @param string $path
|
||||
* @return string
|
||||
*/
|
||||
protected function getViewPath($path)
|
||||
{
|
||||
return implode(DIRECTORY_SEPARATOR, [
|
||||
config('view.paths')[0] ?? resource_path('views'), $path,
|
||||
]);
|
||||
}
|
||||
}
|
92
vendor/laravel/ui/src/AuthRouteMethods.php
vendored
Normal file
92
vendor/laravel/ui/src/AuthRouteMethods.php
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui;
|
||||
|
||||
class AuthRouteMethods
|
||||
{
|
||||
/**
|
||||
* Register the typical authentication routes for an application.
|
||||
*
|
||||
* @param array $options
|
||||
* @return callable
|
||||
*/
|
||||
public function auth()
|
||||
{
|
||||
return function ($options = []) {
|
||||
// Login Routes...
|
||||
if ($options['login'] ?? true) {
|
||||
$this->get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
||||
$this->post('login', 'Auth\LoginController@login');
|
||||
}
|
||||
|
||||
// Logout Routes...
|
||||
if ($options['logout'] ?? true) {
|
||||
$this->post('logout', 'Auth\LoginController@logout')->name('logout');
|
||||
}
|
||||
|
||||
// Registration Routes...
|
||||
if ($options['register'] ?? true) {
|
||||
$this->get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
|
||||
$this->post('register', 'Auth\RegisterController@register');
|
||||
}
|
||||
|
||||
// Password Reset Routes...
|
||||
if ($options['reset'] ?? true) {
|
||||
$this->resetPassword();
|
||||
}
|
||||
|
||||
// Password Confirmation Routes...
|
||||
if ($options['confirm'] ??
|
||||
class_exists($this->prependGroupNamespace('Auth\ConfirmPasswordController'))) {
|
||||
$this->confirmPassword();
|
||||
}
|
||||
|
||||
// Email Verification Routes...
|
||||
if ($options['verify'] ?? false) {
|
||||
$this->emailVerification();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the typical reset password routes for an application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function resetPassword()
|
||||
{
|
||||
return function () {
|
||||
$this->get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
|
||||
$this->post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
|
||||
$this->get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
|
||||
$this->post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.update');
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the typical confirm password routes for an application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function confirmPassword()
|
||||
{
|
||||
return function () {
|
||||
$this->get('password/confirm', 'Auth\ConfirmPasswordController@showConfirmForm')->name('password.confirm');
|
||||
$this->post('password/confirm', 'Auth\ConfirmPasswordController@confirm');
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the typical email verification routes for an application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function emailVerification()
|
||||
{
|
||||
return function () {
|
||||
$this->get('email/verify', 'Auth\VerificationController@show')->name('verification.notice');
|
||||
$this->get('email/verify/{id}/{hash}', 'Auth\VerificationController@verify')->name('verification.verify');
|
||||
$this->post('email/resend', 'Auth\VerificationController@resend')->name('verification.resend');
|
||||
};
|
||||
}
|
||||
}
|
49
vendor/laravel/ui/src/ControllersCommand.php
vendored
Normal file
49
vendor/laravel/ui/src/ControllersCommand.php
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Str;
|
||||
use Symfony\Component\Finder\SplFileInfo;
|
||||
|
||||
class ControllersCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ui:controllers';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Scaffold the authentication controllers';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (! is_dir($directory = app_path('Http/Controllers/Auth'))) {
|
||||
mkdir($directory, 0755, true);
|
||||
}
|
||||
|
||||
$filesystem = new Filesystem;
|
||||
|
||||
collect($filesystem->allFiles(__DIR__.'/../stubs/Auth'))
|
||||
->each(function (SplFileInfo $file) use ($filesystem) {
|
||||
$filesystem->copy(
|
||||
$file->getPathname(),
|
||||
app_path('Http/Controllers/Auth/'.Str::replaceLast('.stub', '.php', $file->getFilename()))
|
||||
);
|
||||
});
|
||||
|
||||
$this->info('Authentication scaffolding generated successfully.');
|
||||
}
|
||||
}
|
72
vendor/laravel/ui/src/Presets/Bootstrap.php
vendored
Normal file
72
vendor/laravel/ui/src/Presets/Bootstrap.php
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
|
||||
class Bootstrap extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::updatePackages();
|
||||
static::updateWebpackConfiguration();
|
||||
static::updateSass();
|
||||
static::updateBootstrapping();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'bootstrap' => '^4.0.0',
|
||||
'jquery' => '^3.2',
|
||||
'popper.js' => '^1.12',
|
||||
'sass' => '^1.15.2',
|
||||
'sass-loader' => '^8.0.0',
|
||||
] + $packages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Webpack configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateWebpackConfiguration()
|
||||
{
|
||||
copy(__DIR__.'/bootstrap-stubs/webpack.mix.js', base_path('webpack.mix.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Sass files for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateSass()
|
||||
{
|
||||
(new Filesystem)->ensureDirectoryExists(resource_path('sass'));
|
||||
|
||||
copy(__DIR__.'/bootstrap-stubs/_variables.scss', resource_path('sass/_variables.scss'));
|
||||
copy(__DIR__.'/bootstrap-stubs/app.scss', resource_path('sass/app.scss'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/bootstrap-stubs/bootstrap.js', resource_path('js/bootstrap.js'));
|
||||
}
|
||||
}
|
65
vendor/laravel/ui/src/Presets/Preset.php
vendored
Normal file
65
vendor/laravel/ui/src/Presets/Preset.php
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
|
||||
class Preset
|
||||
{
|
||||
/**
|
||||
* Ensure the component directories we need exist.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function ensureComponentDirectoryExists()
|
||||
{
|
||||
$filesystem = new Filesystem;
|
||||
|
||||
if (! $filesystem->isDirectory($directory = resource_path('js/components'))) {
|
||||
$filesystem->makeDirectory($directory, 0755, true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the "package.json" file.
|
||||
*
|
||||
* @param bool $dev
|
||||
* @return void
|
||||
*/
|
||||
protected static function updatePackages($dev = true)
|
||||
{
|
||||
if (! file_exists(base_path('package.json'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$configurationKey = $dev ? 'devDependencies' : 'dependencies';
|
||||
|
||||
$packages = json_decode(file_get_contents(base_path('package.json')), true);
|
||||
|
||||
$packages[$configurationKey] = static::updatePackageArray(
|
||||
array_key_exists($configurationKey, $packages) ? $packages[$configurationKey] : [],
|
||||
$configurationKey
|
||||
);
|
||||
|
||||
ksort($packages[$configurationKey]);
|
||||
|
||||
file_put_contents(
|
||||
base_path('package.json'),
|
||||
json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the installed Node modules.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function removeNodeModules()
|
||||
{
|
||||
tap(new Filesystem, function ($files) {
|
||||
$files->deleteDirectory(base_path('node_modules'));
|
||||
|
||||
$files->delete(base_path('yarn.lock'));
|
||||
});
|
||||
}
|
||||
}
|
76
vendor/laravel/ui/src/Presets/React.php
vendored
Normal file
76
vendor/laravel/ui/src/Presets/React.php
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class React extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::ensureComponentDirectoryExists();
|
||||
static::updatePackages();
|
||||
static::updateWebpackConfiguration();
|
||||
static::updateBootstrapping();
|
||||
static::updateComponent();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'@babel/preset-react' => '^7.0.0',
|
||||
'react' => '^16.2.0',
|
||||
'react-dom' => '^16.2.0',
|
||||
] + Arr::except($packages, ['vue', 'vue-template-compiler']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Webpack configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateWebpackConfiguration()
|
||||
{
|
||||
copy(__DIR__.'/react-stubs/webpack.mix.js', base_path('webpack.mix.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the example component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateComponent()
|
||||
{
|
||||
(new Filesystem)->delete(
|
||||
resource_path('js/components/ExampleComponent.vue')
|
||||
);
|
||||
|
||||
copy(
|
||||
__DIR__.'/react-stubs/Example.js',
|
||||
resource_path('js/components/Example.js')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/react-stubs/app.js', resource_path('js/app.js'));
|
||||
}
|
||||
}
|
82
vendor/laravel/ui/src/Presets/Vue.php
vendored
Normal file
82
vendor/laravel/ui/src/Presets/Vue.php
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui\Presets;
|
||||
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
class Vue extends Preset
|
||||
{
|
||||
/**
|
||||
* Install the preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function install()
|
||||
{
|
||||
static::ensureComponentDirectoryExists();
|
||||
static::updatePackages();
|
||||
static::updateWebpackConfiguration();
|
||||
static::updateBootstrapping();
|
||||
static::updateComponent();
|
||||
static::removeNodeModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the given package array.
|
||||
*
|
||||
* @param array $packages
|
||||
* @return array
|
||||
*/
|
||||
protected static function updatePackageArray(array $packages)
|
||||
{
|
||||
return [
|
||||
'resolve-url-loader' => '^2.3.1',
|
||||
'sass' => '^1.20.1',
|
||||
'sass-loader' => '^8.0.0',
|
||||
'vue' => '^2.5.17',
|
||||
'vue-template-compiler' => '^2.6.10',
|
||||
] + Arr::except($packages, [
|
||||
'@babel/preset-react',
|
||||
'react',
|
||||
'react-dom',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the Webpack configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateWebpackConfiguration()
|
||||
{
|
||||
copy(__DIR__.'/vue-stubs/webpack.mix.js', base_path('webpack.mix.js'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the example component.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateComponent()
|
||||
{
|
||||
(new Filesystem)->delete(
|
||||
resource_path('js/components/Example.js')
|
||||
);
|
||||
|
||||
copy(
|
||||
__DIR__.'/vue-stubs/ExampleComponent.vue',
|
||||
resource_path('js/components/ExampleComponent.vue')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the bootstrapping files.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected static function updateBootstrapping()
|
||||
{
|
||||
copy(__DIR__.'/vue-stubs/app.js', resource_path('js/app.js'));
|
||||
}
|
||||
}
|
19
vendor/laravel/ui/src/Presets/bootstrap-stubs/_variables.scss
vendored
Normal file
19
vendor/laravel/ui/src/Presets/bootstrap-stubs/_variables.scss
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
// Body
|
||||
$body-bg: #f8fafc;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: 'Nunito', sans-serif;
|
||||
$font-size-base: 0.9rem;
|
||||
$line-height-base: 1.6;
|
||||
|
||||
// Colors
|
||||
$blue: #3490dc;
|
||||
$indigo: #6574cd;
|
||||
$purple: #9561e2;
|
||||
$pink: #f66d9b;
|
||||
$red: #e3342f;
|
||||
$orange: #f6993f;
|
||||
$yellow: #ffed4a;
|
||||
$green: #38c172;
|
||||
$teal: #4dc0b5;
|
||||
$cyan: #6cb2eb;
|
8
vendor/laravel/ui/src/Presets/bootstrap-stubs/app.scss
vendored
Normal file
8
vendor/laravel/ui/src/Presets/bootstrap-stubs/app.scss
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// Fonts
|
||||
@import url('https://fonts.googleapis.com/css?family=Nunito');
|
||||
|
||||
// Variables
|
||||
@import 'variables';
|
||||
|
||||
// Bootstrap
|
||||
@import '~bootstrap/scss/bootstrap';
|
41
vendor/laravel/ui/src/Presets/bootstrap-stubs/bootstrap.js
vendored
Normal file
41
vendor/laravel/ui/src/Presets/bootstrap-stubs/bootstrap.js
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
window._ = require('lodash');
|
||||
|
||||
/**
|
||||
* We'll load jQuery and the Bootstrap jQuery plugin which provides support
|
||||
* for JavaScript based Bootstrap features such as modals and tabs. This
|
||||
* code may be modified to fit the specific needs of your application.
|
||||
*/
|
||||
|
||||
try {
|
||||
window.Popper = require('popper.js').default;
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
|
||||
require('bootstrap');
|
||||
} catch (e) {}
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
* CSRF token as a header based on the value of the "XSRF" token cookie.
|
||||
*/
|
||||
|
||||
window.axios = require('axios');
|
||||
|
||||
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
||||
|
||||
/**
|
||||
* Echo exposes an expressive API for subscribing to channels and listening
|
||||
* for events that are broadcast by Laravel. Echo and event broadcasting
|
||||
* allows your team to easily build robust real-time web applications.
|
||||
*/
|
||||
|
||||
// import Echo from 'laravel-echo';
|
||||
|
||||
// window.Pusher = require('pusher-js');
|
||||
|
||||
// window.Echo = new Echo({
|
||||
// broadcaster: 'pusher',
|
||||
// key: process.env.MIX_PUSHER_APP_KEY,
|
||||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
|
||||
// forceTLS: true
|
||||
// });
|
15
vendor/laravel/ui/src/Presets/bootstrap-stubs/webpack.mix.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/bootstrap-stubs/webpack.mix.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const mix = require('laravel-mix');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.js('resources/js/app.js', 'public/js')
|
||||
.sass('resources/sass/app.scss', 'public/css');
|
24
vendor/laravel/ui/src/Presets/react-stubs/Example.js
vendored
Normal file
24
vendor/laravel/ui/src/Presets/react-stubs/Example.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
function Example() {
|
||||
return (
|
||||
<div className="container">
|
||||
<div className="row justify-content-center">
|
||||
<div className="col-md-8">
|
||||
<div className="card">
|
||||
<div className="card-header">Example Component</div>
|
||||
|
||||
<div className="card-body">I'm an example component!</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Example;
|
||||
|
||||
if (document.getElementById('example')) {
|
||||
ReactDOM.render(<Example />, document.getElementById('example'));
|
||||
}
|
15
vendor/laravel/ui/src/Presets/react-stubs/app.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/react-stubs/app.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes React and other helpers. It's a great starting point while
|
||||
* building robust, powerful web applications using React + Laravel.
|
||||
*/
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh React component instance and attach it to
|
||||
* the page. Then, you may begin adding components to this application
|
||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
require('./components/Example');
|
15
vendor/laravel/ui/src/Presets/react-stubs/webpack.mix.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/react-stubs/webpack.mix.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const mix = require('laravel-mix');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.react('resources/js/app.js', 'public/js')
|
||||
.sass('resources/sass/app.scss', 'public/css');
|
23
vendor/laravel/ui/src/Presets/vue-stubs/ExampleComponent.vue
vendored
Normal file
23
vendor/laravel/ui/src/Presets/vue-stubs/ExampleComponent.vue
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Example Component</div>
|
||||
|
||||
<div class="card-body">
|
||||
I'm an example component.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
mounted() {
|
||||
console.log('Component mounted.')
|
||||
}
|
||||
}
|
||||
</script>
|
32
vendor/laravel/ui/src/Presets/vue-stubs/app.js
vendored
Normal file
32
vendor/laravel/ui/src/Presets/vue-stubs/app.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
* building robust, powerful web applications using Vue and Laravel.
|
||||
*/
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
window.Vue = require('vue');
|
||||
|
||||
/**
|
||||
* The following block of code may be used to automatically register your
|
||||
* Vue components. It will recursively scan this directory for the Vue
|
||||
* components and automatically register them with their "basename".
|
||||
*
|
||||
* Eg. ./components/ExampleComponent.vue -> <example-component></example-component>
|
||||
*/
|
||||
|
||||
// const files = require.context('./', true, /\.vue$/i)
|
||||
// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default))
|
||||
|
||||
Vue.component('example-component', require('./components/ExampleComponent.vue').default);
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh Vue application instance and attach it to
|
||||
* the page. Then, you may begin adding components to this application
|
||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app',
|
||||
});
|
15
vendor/laravel/ui/src/Presets/vue-stubs/webpack.mix.js
vendored
Normal file
15
vendor/laravel/ui/src/Presets/vue-stubs/webpack.mix.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
const mix = require('laravel-mix');
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mix Asset Management
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Mix provides a clean, fluent API for defining some Webpack build steps
|
||||
| for your Laravel application. By default, we are compiling the Sass
|
||||
| file for the application as well as bundling up all the JS files.
|
||||
|
|
||||
*/
|
||||
|
||||
mix.js('resources/js/app.js', 'public/js')
|
||||
.sass('resources/sass/app.scss', 'public/css');
|
91
vendor/laravel/ui/src/UiCommand.php
vendored
Normal file
91
vendor/laravel/ui/src/UiCommand.php
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class UiCommand extends Command
|
||||
{
|
||||
/**
|
||||
* The console command signature.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'ui
|
||||
{ type : The preset type (bootstrap, vue, react) }
|
||||
{ --auth : Install authentication UI scaffolding }
|
||||
{ --option=* : Pass an option to the preset command }';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Swap the front-end scaffolding for the application';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
if (static::hasMacro($this->argument('type'))) {
|
||||
return call_user_func(static::$macros[$this->argument('type')], $this);
|
||||
}
|
||||
|
||||
if (! in_array($this->argument('type'), ['bootstrap', 'vue', 'react'])) {
|
||||
throw new InvalidArgumentException('Invalid preset.');
|
||||
}
|
||||
|
||||
$this->{$this->argument('type')}();
|
||||
|
||||
if ($this->option('auth')) {
|
||||
$this->call('ui:auth');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the "bootstrap" preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function bootstrap()
|
||||
{
|
||||
Presets\Bootstrap::install();
|
||||
|
||||
$this->info('Bootstrap scaffolding installed successfully.');
|
||||
$this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the "vue" preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function vue()
|
||||
{
|
||||
Presets\Bootstrap::install();
|
||||
Presets\Vue::install();
|
||||
|
||||
$this->info('Vue scaffolding installed successfully.');
|
||||
$this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the "react" preset.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function react()
|
||||
{
|
||||
Presets\Bootstrap::install();
|
||||
Presets\React::install();
|
||||
|
||||
$this->info('React scaffolding installed successfully.');
|
||||
$this->comment('Please run "npm install && npm run dev" to compile your fresh scaffolding.');
|
||||
}
|
||||
}
|
35
vendor/laravel/ui/src/UiServiceProvider.php
vendored
Normal file
35
vendor/laravel/ui/src/UiServiceProvider.php
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Laravel\Ui;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class UiServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register the package services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([
|
||||
AuthCommand::class,
|
||||
ControllersCommand::class,
|
||||
UiCommand::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Route::mixin(new AuthRouteMethods);
|
||||
}
|
||||
}
|
40
vendor/laravel/ui/stubs/Auth/ConfirmPasswordController.stub
vendored
Normal file
40
vendor/laravel/ui/stubs/Auth/ConfirmPasswordController.stub
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
22
vendor/laravel/ui/stubs/Auth/ForgotPasswordController.stub
vendored
Normal file
22
vendor/laravel/ui/stubs/Auth/ForgotPasswordController.stub
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
40
vendor/laravel/ui/stubs/Auth/LoginController.stub
vendored
Normal file
40
vendor/laravel/ui/stubs/Auth/LoginController.stub
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
73
vendor/laravel/ui/stubs/Auth/RegisterController.stub
vendored
Normal file
73
vendor/laravel/ui/stubs/Auth/RegisterController.stub
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \App\User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
30
vendor/laravel/ui/stubs/Auth/ResetPasswordController.stub
vendored
Normal file
30
vendor/laravel/ui/stubs/Auth/ResetPasswordController.stub
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
}
|
42
vendor/laravel/ui/stubs/Auth/VerificationController.stub
vendored
Normal file
42
vendor/laravel/ui/stubs/Auth/VerificationController.stub
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
32
vendor/laravel/ui/stubs/migrations/2014_10_12_100000_create_password_resets_table.php
vendored
Normal file
32
vendor/laravel/ui/stubs/migrations/2014_10_12_100000_create_password_resets_table.php
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user