diff --git a/.env.example b/.env.example index 604b401f..ac748637 100644 --- a/.env.example +++ b/.env.example @@ -23,12 +23,14 @@ REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 -MAIL_DRIVER=smtp +MAIL_MAILER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= diff --git a/CHANGELOG.md b/CHANGELOG.md index ab862b15..a023f703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,122 @@ # Release Notes -## [Unreleased](https://github.com/laravel/laravel/compare/v5.8.3...develop) +## [Unreleased](https://github.com/laravel/laravel/compare/v6.8.0...develop) + + +## [v6.8.0 (2019-12-16)](https://github.com/laravel/laravel/compare/v6.5.2...v6.8.0) + +### Added +- Add "none" to supported same site options in session config ([#5174](https://github.com/laravel/laravel/pull/5174)) + +### Changed +- Rename `encrypted` to `forceTLS` for Pusher ([#5159](https://github.com/laravel/laravel/pull/5159)) +- Use laravel/tinker v2 ([#5161](https://github.com/laravel/laravel/pull/5161)) +- Use PHPUnit TestCase and in-memory DB ([#5169](https://github.com/laravel/laravel/pull/5169)) +- DRY up path to /home ([#5173](https://github.com/laravel/laravel/pull/5173)) +- Change some default settings ([f48e2d5](https://github.com/laravel/laravel/commit/f48e2d500cb53cc4a09dfcb40beb0abafd79de4f)) + +### Fixed +- Consistent alphabetical order ([#5167](https://github.com/laravel/laravel/pull/5167)) +- Update redirectTo return type PHPDoc ([#5175](https://github.com/laravel/laravel/pull/5175)) + + +## [v6.5.2 (2019-11-21)](https://github.com/laravel/laravel/compare/v6.4.0...v6.5.2) + +### Changed +- Update .styleci.yml ([bfd4b1e](https://github.com/laravel/laravel/commit/bfd4b1e92f7c6b4e6b74cfdde995a5afad648d96)) + + +## [v6.4.0 (2019-10-21)](https://github.com/laravel/laravel/compare/v6.2.0...v6.4.0) + +### Changed +- Add xml schema to phpunit ([#5139](https://github.com/laravel/laravel/pull/5139)) + +### Fixed +- Fixes required version of the framework within `composer.json` ([#5130](https://github.com/laravel/laravel/pull/5130)) +- Security fix: Waiting before retrying password reset ([ace38c1](https://github.com/laravel/laravel/commit/ace38c133f3d8088fc7477f56b9db6fdc0098d06), [ba2f2ab](https://github.com/laravel/laravel/commit/ba2f2abe830f5d03c52fd9c88411859cf863abd6), [953b488](https://github.com/laravel/laravel/commit/953b488b8bb681d4d6e12227645c7c1b7ac26935)) + + +## [v6.2.0 (2019-10-08)](https://github.com/laravel/laravel/compare/v6.0.2...v6.2.0) + +### Added +- Add 'null' logging channel ([#5106](https://github.com/laravel/laravel/pull/5106)) +- Add Password confirmation ([#5129](https://github.com/laravel/laravel/pull/5129), [d1f7a5a](https://github.com/laravel/laravel/commit/d1f7a5a886039e28a434905447865ca952032284), [9bc23ee](https://github.com/laravel/laravel/commit/9bc23ee468e1fb3e5b4efccdc35f1fcee5a8b6bc)) + +### Removed +- Remove testing bootstrap extension ([#5107](https://github.com/laravel/laravel/pull/5107)) + +### Fixed +- Revert "[6.x] According to PHP Bug 78516 Argon2 requires at least 8KB" ([#5102]()https://github.com/laravel/laravel/pull/5102) + + +## [v6.0.2 (2019-09-10)](https://github.com/laravel/laravel/compare/v6.0.1...v6.0.2) + +### Changed +- Order imports alphabetically ([79fb6af](https://github.com/laravel/laravel/commit/79fb6af96ebf0325cef15c3132157fdf75f6fd6c), [#5100](https://github.com/laravel/laravel/pull/5100)) + +### Fixed +- Delete cached config file before running tests ([#5091](https://github.com/laravel/laravel/pull/5091)) +- Update Argon memory ([#5097](https://github.com/laravel/laravel/pull/5097)) + + +## [v6.0.1 (2019-08-27)](https://github.com/laravel/laravel/compare/v6.0.0...v6.0.1) + +### Added +- Add Ignition ([41ee35d](https://github.com/laravel/laravel/commit/41ee35d01f4e57c47e924400db8a805089664141), [13ab419](https://github.com/laravel/laravel/commit/13ab419d59e2f0d2e188a5157a3cc17f72db595c)) + + +## [v6.0.0 (2019-08-27)](https://github.com/laravel/laravel/compare/v5.8.35...v6.0.0) + +### Added +- Add ThrottleRequests to the priority array ([#5057](https://github.com/laravel/laravel/pull/5057)) +- Add PHPUnit bootstrap file to allow execution of console commands before a test run ([#5050](https://github.com/laravel/laravel/pull/5050), [8f2a278](https://github.com/laravel/laravel/commit/8f2a27868f7f9e0a0bbf69fa83d06b8a7a1b7894)) +- Add failed jobs table ([b7d2b48](https://github.com/laravel/laravel/commit/b7d2b48b75afbaa34c82688cb30be2f00a7d8c57), [#5082](https://github.com/laravel/laravel/pull/5082)) +- Add new failed driver option ([e6becd2](https://github.com/laravel/laravel/commit/e6becd2ca35a650f51ed49525935e8ca65671152)) ### Changed - Require PHP 7.2 ([25cf4c4](https://github.com/laravel/laravel/commit/25cf4c492308b9c5148f9522d8dd8f8f18819f50)) - Encourage to use PHPUnit 8 ([0582a20](https://github.com/laravel/laravel/commit/0582a20adddc0e6bd16ca05eeae93e6412924ad6)) +- Use phpredis as default Redis client ([#5085](https://github.com/laravel/laravel/pull/5085)) + +### Removed +- Remove services deleted from core ([#5019](https://github.com/laravel/laravel/pull/5019)) +- Remove dumpserver ([f053116](https://github.com/laravel/laravel/commit/f053116c5680e77c3a6c73afd193984a17ea482d)) +- Remove UI scaffolding ([fc39b07](https://github.com/laravel/laravel/commit/fc39b073f3f61a22f1b48329e294ebb881700dbe)) +- Remove deprecated language line ([#5074](https://github.com/laravel/laravel/pull/5074)) + + +## [v5.8.35 (2019-09-09)](https://github.com/laravel/laravel/compare/v5.8.17...v5.8.35) + +### Added +- Add DYNAMODB_ENDPOINT to the cache config ([#5034](https://github.com/laravel/laravel/pull/5034)) +- Added support for new redis URL property ([#5037](https://github.com/laravel/laravel/pull/5037)) +- Add .env.backup to gitignore ([#5046](https://github.com/laravel/laravel/pull/5046)) +- Using environment variable to set redis prefix ([#5062](https://github.com/laravel/laravel/pull/5062)) + +### Changed +- Update axios package ([#5038](https://github.com/laravel/laravel/pull/5038)) +- Use generic default db config ([6f3d68f](https://github.com/laravel/laravel/commit/6f3d68f67f3dab0e0d853719696ede8dfd9cc4e1)) +- Update deprecated pusher option ([#5058](https://github.com/laravel/laravel/pull/5058)) +- Move TrustProxies to highest priority ([#5055](https://github.com/laravel/laravel/pull/5055)) + +### Fixed +- Fixed lodash version ([#5060](https://github.com/laravel/laravel/pull/5060)) + +### Removed +- Remove Stripe config settings ([#5075](https://github.com/laravel/laravel/pull/5075), [bb43372](https://github.com/laravel/laravel/commit/bb433725483803a27f21d3b21317072610bc3e9c)) +- Remove unnecessary X-CSRF-TOKEN header from our Axios instance ([#5083](https://github.com/laravel/laravel/pull/5083)) + + +## [v5.8.17 (2019-05-14)](https://github.com/laravel/laravel/compare/v5.8.16...v5.8.17) + +### Added +- Add ends_with validation message ([#5020](https://github.com/laravel/laravel/pull/5020)) + +### Fixed +- Fix type hint for case of trusting all proxies (string) ([#5025](https://github.com/laravel/laravel/pull/5025)) -## [v5.8.16 (2019-05-07)](https://github.com/laravel/laravel/compare/v5.8.3...master) +## [v5.8.16 (2019-05-07)](https://github.com/laravel/laravel/compare/v5.8.3...v5.8.16) ### Added - Add IDE type-hint to UserFactory ([#4990](https://github.com/laravel/laravel/pull/4990)) diff --git a/readme.md b/README.md similarity index 91% rename from readme.md rename to README.md index f95b2ec9..81f2f62b 100644 --- a/readme.md +++ b/README.md @@ -58,15 +58,21 @@ We would like to extend our thanks to the following sponsors for funding Laravel - [Understand.io](https://www.understand.io/) - [Abdel Elrafa](https://abdelelrafa.com) - [Hyper Host](https://hyper.host) +- [Appoly](https://www.appoly.co.uk) +- [OP.GG](https://op.gg) ## Contributing Thank you for considering contributing to the Laravel framework! 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 If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. ## License -The Laravel framework is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT). +The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index a8c51585..69914e99 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -24,8 +24,7 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { - // $schedule->command('inspire') - // ->hourly(); + // $schedule->command('inspire')->hourly(); } /** diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 043cad6b..59c585dc 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,8 +2,8 @@ namespace App\Exceptions; -use Exception; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; +use Throwable; class Handler extends ExceptionHandler { @@ -29,10 +29,12 @@ class Handler extends ExceptionHandler /** * Report or log an exception. * - * @param \Exception $exception + * @param \Throwable $exception * @return void + * + * @throws \Exception */ - public function report(Exception $exception) + public function report(Throwable $exception) { parent::report($exception); } @@ -41,10 +43,12 @@ class Handler extends ExceptionHandler * Render an exception into an HTTP response. * * @param \Illuminate\Http\Request $request - * @param \Exception $exception - * @return \Illuminate\Http\Response + * @param \Throwable $exception + * @return \Symfony\Component\HttpFoundation\Response + * + * @throws \Throwable */ - public function render($request, Exception $exception) + public function render($request, Throwable $exception) { return parent::render($request, $exception); } diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php deleted file mode 100644 index 6a247fef..00000000 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ /dev/null @@ -1,32 +0,0 @@ -<?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; - - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('guest'); - } -} diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php deleted file mode 100644 index b2ea669a..00000000 --- a/app/Http/Controllers/Auth/LoginController.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace App\Http\Controllers\Auth; - -use App\Http\Controllers\Controller; -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 = '/home'; - - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('guest')->except('logout'); - } -} diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php deleted file mode 100644 index 85b9057a..00000000 --- a/app/Http/Controllers/Auth/RegisterController.php +++ /dev/null @@ -1,72 +0,0 @@ -<?php - -namespace App\Http\Controllers\Auth; - -use App\User; -use App\Http\Controllers\Controller; -use Illuminate\Support\Facades\Hash; -use Illuminate\Support\Facades\Validator; -use Illuminate\Foundation\Auth\RegistersUsers; - -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 = '/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']), - ]); - } -} diff --git a/app/Http/Controllers/Auth/ResetPasswordController.php b/app/Http/Controllers/Auth/ResetPasswordController.php deleted file mode 100644 index cf726eec..00000000 --- a/app/Http/Controllers/Auth/ResetPasswordController.php +++ /dev/null @@ -1,39 +0,0 @@ -<?php - -namespace App\Http\Controllers\Auth; - -use App\Http\Controllers\Controller; -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 = '/home'; - - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('guest'); - } -} diff --git a/app/Http/Controllers/Auth/VerificationController.php b/app/Http/Controllers/Auth/VerificationController.php deleted file mode 100644 index 23a43a84..00000000 --- a/app/Http/Controllers/Auth/VerificationController.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -namespace App\Http\Controllers\Auth; - -use App\Http\Controllers\Controller; -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 = '/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'); - } -} diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index 03e02a23..a0a2a8a3 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -2,10 +2,10 @@ namespace App\Http\Controllers; +use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; -use Illuminate\Routing\Controller as BaseController; use Illuminate\Foundation\Validation\ValidatesRequests; -use Illuminate\Foundation\Auth\Access\AuthorizesRequests; +use Illuminate\Routing\Controller as BaseController; class Controller extends BaseController { diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 0d7d8c15..c3640f30 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -15,6 +15,7 @@ class Kernel extends HttpKernel */ protected $middleware = [ \App\Http\Middleware\TrustProxies::class, + \Fruitcake\Cors\HandleCors::class, \App\Http\Middleware\CheckForMaintenanceMode::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, @@ -39,7 +40,7 @@ class Kernel extends HttpKernel 'api' => [ 'throttle:60,1', - 'bindings', + \Illuminate\Routing\Middleware\SubstituteBindings::class, ], ]; @@ -57,25 +58,9 @@ class Kernel extends HttpKernel 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, ]; - - /** - * The priority-sorted list of middleware. - * - * This forces non-global middleware to always be in the given order. - * - * @var array - */ - protected $middlewarePriority = [ - \Illuminate\Session\Middleware\StartSession::class, - \Illuminate\View\Middleware\ShareErrorsFromSession::class, - \App\Http\Middleware\Authenticate::class, - \Illuminate\Routing\Middleware\ThrottleRequests::class, - \Illuminate\Session\Middleware\AuthenticateSession::class, - \Illuminate\Routing\Middleware\SubstituteBindings::class, - \Illuminate\Auth\Middleware\Authorize::class, - ]; } diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4be5c58..704089a7 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -10,7 +10,7 @@ class Authenticate extends Middleware * Get the path the user should be redirected to when they are not authenticated. * * @param \Illuminate\Http\Request $request - * @return string + * @return string|null */ protected function redirectTo($request) { diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e4cec9c8..2395ddcc 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use App\Providers\RouteServiceProvider; use Closure; use Illuminate\Support\Facades\Auth; @@ -18,7 +19,7 @@ class RedirectIfAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { - return redirect('/home'); + return redirect(RouteServiceProvider::HOME); } return $next($request); diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 12fdf8b5..ee5b5958 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,8 +2,8 @@ namespace App\Http\Middleware; -use Illuminate\Http\Request; use Fideloper\Proxy\TrustProxies as Middleware; +use Illuminate\Http\Request; class TrustProxies extends Middleware { diff --git a/app/Http/Middleware/VerifyCsrfToken.php b/app/Http/Middleware/VerifyCsrfToken.php index 324a166b..0c13b854 100644 --- a/app/Http/Middleware/VerifyCsrfToken.php +++ b/app/Http/Middleware/VerifyCsrfToken.php @@ -6,13 +6,6 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware; class VerifyCsrfToken extends Middleware { - /** - * Indicates whether the XSRF-TOKEN cookie should be set on the response. - * - * @var bool - */ - protected $addHttpCookie = true; - /** * The URIs that should be excluded from CSRF verification. * diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 0acc984b..30490683 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Gate; class AuthServiceProvider extends ServiceProvider { diff --git a/app/Providers/BroadcastServiceProvider.php b/app/Providers/BroadcastServiceProvider.php index 352cce44..395c518b 100644 --- a/app/Providers/BroadcastServiceProvider.php +++ b/app/Providers/BroadcastServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\ServiceProvider; use Illuminate\Support\Facades\Broadcast; +use Illuminate\Support\ServiceProvider; class BroadcastServiceProvider extends ServiceProvider { diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 6c64e52b..723a290d 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -2,10 +2,10 @@ namespace App\Providers; -use Illuminate\Support\Facades\Event; use Illuminate\Auth\Events\Registered; use Illuminate\Auth\Listeners\SendEmailVerificationNotification; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Event; class EventServiceProvider extends ServiceProvider { diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 5ea48d39..527eee34 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,8 +2,8 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { @@ -16,6 +16,13 @@ class RouteServiceProvider extends ServiceProvider */ protected $namespace = 'App\Http\Controllers'; + /** + * The path to the "home" route for your application. + * + * @var string + */ + public const HOME = '/home'; + /** * Define your route model bindings, pattern filters, etc. * diff --git a/app/User.php b/app/User.php index faa03c3b..e79dab7f 100644 --- a/app/User.php +++ b/app/User.php @@ -2,9 +2,9 @@ namespace App; -use Illuminate\Notifications\Notifiable; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Foundation\Auth\User as Authenticatable; +use Illuminate\Notifications\Notifiable; class User extends Authenticatable { diff --git a/composer.json b/composer.json index 7cd832e8..4e81d21a 100644 --- a/composer.json +++ b/composer.json @@ -8,17 +8,19 @@ ], "license": "MIT", "require": { - "php": "^7.2", - "fideloper/proxy": "^4.0", - "laravel/framework": "^6.0", - "laravel/tinker": "^1.0" + "php": "^7.2.5", + "fideloper/proxy": "^4.2", + "fruitcake/laravel-cors": "^1.0", + "guzzlehttp/guzzle": "^6.3", + "laravel/framework": "^7.0", + "laravel/tinker": "^2.0" }, "require-dev": { - "facade/ignition": "^1.4", - "fzaninotto/faker": "^1.4", - "mockery/mockery": "^1.0", - "nunomaduro/collision": "^3.0", - "phpunit/phpunit": "^8.0" + "facade/ignition": "^2.0", + "fzaninotto/faker": "^1.9.1", + "mockery/mockery": "^1.3.1", + "nunomaduro/collision": "^4.1", + "phpunit/phpunit": "^8.5" }, "config": { "optimize-autoloader": true, diff --git a/config/app.php b/config/app.php index c9960cde..5757ea7e 100644 --- a/config/app.php +++ b/config/app.php @@ -207,6 +207,7 @@ return [ 'File' => Illuminate\Support\Facades\File::class, 'Gate' => Illuminate\Support\Facades\Gate::class, 'Hash' => Illuminate\Support\Facades\Hash::class, + 'Http' => Illuminate\Support\Facades\Http::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, diff --git a/config/auth.php b/config/auth.php index 897dc826..aaf982bc 100644 --- a/config/auth.php +++ b/config/auth.php @@ -97,7 +97,21 @@ return [ 'provider' => 'users', 'table' => 'password_resets', 'expire' => 60, + 'throttle' => 60, ], ], + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + ]; diff --git a/config/cors.php b/config/cors.php new file mode 100644 index 00000000..5c9de897 --- /dev/null +++ b/config/cors.php @@ -0,0 +1,34 @@ +<?php + +return [ + + /* + |-------------------------------------------------------------------------- + | Cross-Origin Resource Sharing (CORS) Configuration + |-------------------------------------------------------------------------- + | + | Here you may configure your settings for cross-origin resource sharing + | or "CORS". This determines what cross-origin operations may execute + | in web browsers. You are free to adjust these settings as needed. + | + | To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS + | + */ + + 'paths' => ['api/*'], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => false, + + 'max_age' => false, + + 'supports_credentials' => false, + +]; diff --git a/config/database.php b/config/database.php index 199382d0..b42d9b30 100644 --- a/config/database.php +++ b/config/database.php @@ -130,16 +130,16 @@ return [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_DB', 0), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), ], 'cache' => [ 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_CACHE_DB', 1), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), ], ], diff --git a/config/filesystems.php b/config/filesystems.php index ec6a7cec..cd9f0962 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -66,4 +66,19 @@ return [ ], + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + ]; diff --git a/config/logging.php b/config/logging.php index d09cd7d2..088c204e 100644 --- a/config/logging.php +++ b/config/logging.php @@ -1,5 +1,6 @@ <?php +use Monolog\Handler\NullHandler; use Monolog\Handler\StreamHandler; use Monolog\Handler\SyslogUdpHandler; @@ -36,7 +37,7 @@ return [ 'channels' => [ 'stack' => [ 'driver' => 'stack', - 'channels' => ['daily'], + 'channels' => ['single'], 'ignore_exceptions' => false, ], @@ -89,6 +90,15 @@ return [ 'driver' => 'errorlog', 'level' => 'debug', ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), + ], ], ]; diff --git a/config/mail.php b/config/mail.php index 3c65eb3f..67fb3409 100644 --- a/config/mail.php +++ b/config/mail.php @@ -4,45 +4,63 @@ return [ /* |-------------------------------------------------------------------------- - | Mail Driver + | Default Mailer |-------------------------------------------------------------------------- | - | Laravel supports both SMTP and PHP's "mail" function as drivers for the - | sending of e-mail. You may specify which one you're using throughout - | your application here. By default, Laravel is setup for SMTP mail. - | - | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array" + | This option controls the default mailer that is used to send any email + | messages sent by your application. Alternative mailers may be setup + | and used as needed; however, this mailer will be used by default. | */ - 'driver' => env('MAIL_DRIVER', 'smtp'), + 'default' => env('MAIL_MAILER', 'smtp'), /* |-------------------------------------------------------------------------- - | SMTP Host Address + | Mailer Configurations |-------------------------------------------------------------------------- | - | Here you may provide the host address of the SMTP server used by your - | applications. A default option is provided that is compatible with - | the Mailgun mail service which will provide reliable deliveries. + | Here you may configure all of the mailers used by your application plus + | their respective settings. Several examples have been configured for + | you and you are free to add your own as your application requires. | - */ - - 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), - - /* - |-------------------------------------------------------------------------- - | SMTP Host Port - |-------------------------------------------------------------------------- + | Laravel supports a variety of mail "transport" drivers to be used while + | sending an e-mail. You will specify which one you are using for your + | mailers below. You are free to add additional mailers as required. | - | This is the SMTP port used by your application to deliver e-mails to - | users of the application. Like the host we have set this value to - | stay compatible with the Mailgun e-mail application by default. + | Supported: "smtp", "sendmail", "mailgun", "ses", + | "postmark", "log", "array" | */ - 'port' => env('MAIL_PORT', 587), + 'mailers' => [ + 'smtp' => [ + 'transport' => 'smtp', + 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), + 'port' => env('MAIL_PORT', 587), + 'encryption' => env('MAIL_ENCRYPTION', 'tls'), + 'username' => env('MAIL_USERNAME'), + 'password' => env('MAIL_PASSWORD'), + ], + + 'ses' => [ + 'transport' => 'ses', + ], + + 'sendmail' => [ + 'transport' => 'sendmail', + 'path' => '/usr/sbin/sendmail -bs', + ], + + 'log' => [ + 'transport' => 'log', + 'channel' => env('MAIL_LOG_CHANNEL'), + ], + + 'array' => [ + 'transport' => 'array', + ], + ], /* |-------------------------------------------------------------------------- @@ -60,47 +78,6 @@ return [ 'name' => env('MAIL_FROM_NAME', 'Example'), ], - /* - |-------------------------------------------------------------------------- - | E-Mail Encryption Protocol - |-------------------------------------------------------------------------- - | - | Here you may specify the encryption protocol that should be used when - | the application send e-mail messages. A sensible default using the - | transport layer security protocol should provide great security. - | - */ - - 'encryption' => env('MAIL_ENCRYPTION', 'tls'), - - /* - |-------------------------------------------------------------------------- - | SMTP Server Username - |-------------------------------------------------------------------------- - | - | If your SMTP server requires a username for authentication, you should - | set it here. This will get used to authenticate with your server on - | connection. You may also set the "password" value below this one. - | - */ - - 'username' => env('MAIL_USERNAME'), - - 'password' => env('MAIL_PASSWORD'), - - /* - |-------------------------------------------------------------------------- - | Sendmail System Path - |-------------------------------------------------------------------------- - | - | When using the "sendmail" driver to send e-mails, we will need to know - | the path to where Sendmail lives on this server. A default path has - | been provided here, which will work well on most of your systems. - | - */ - - 'sendmail' => '/usr/sbin/sendmail -bs', - /* |-------------------------------------------------------------------------- | Markdown Mail Settings @@ -120,17 +97,4 @@ return [ ], ], - /* - |-------------------------------------------------------------------------- - | Log Channel - |-------------------------------------------------------------------------- - | - | If you are using the "log" driver, you may specify the logging channel - | if you prefer to keep mail messages separate from other log entries - | for simpler reading. Otherwise, the default channel will be used. - | - */ - - 'log_channel' => env('MAIL_LOG_CHANNEL'), - ]; diff --git a/config/session.php b/config/session.php index fbb9b4d7..bc9174f4 100644 --- a/config/session.php +++ b/config/session.php @@ -166,7 +166,7 @@ return [ | */ - 'secure' => env('SESSION_SECURE_COOKIE', false), + 'secure' => env('SESSION_SECURE_COOKIE', null), /* |-------------------------------------------------------------------------- @@ -190,10 +190,10 @@ return [ | take place, and can be used to mitigate CSRF attacks. By default, we | do not enable this as other CSRF protection services are in place. | - | Supported: "lax", "strict" + | Supported: "lax", "strict", "none" | */ - 'same_site' => null, + 'same_site' => 'lax', ]; diff --git a/config/view.php b/config/view.php index 22b8a18d..bc73d32b 100644 --- a/config/view.php +++ b/config/view.php @@ -33,4 +33,17 @@ return [ realpath(storage_path('framework/views')) ), + /* + |-------------------------------------------------------------------------- + | Blade View Modification Checking + |-------------------------------------------------------------------------- + | + | On every request the framework will check to see if a view has expired + | to determine if it needs to be recompiled. If you are in production + | and precompiling views this feature may be disabled to save time. + | + */ + + 'expires' => env('VIEW_CHECK_EXPIRATION', true), + ]; diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index 5e516cee..741edead 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,9 +1,10 @@ <?php /** @var \Illuminate\Database\Eloquent\Factory $factory */ + use App\User; -use Illuminate\Support\Str; use Faker\Generator as Faker; +use Illuminate\Support\Str; /* |-------------------------------------------------------------------------- diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 4a3ba472..621a24eb 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -1,8 +1,8 @@ <?php -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { @@ -14,7 +14,7 @@ class CreateUsersTable extends Migration public function up() { Schema::create('users', function (Blueprint $table) { - $table->bigIncrements('id'); + $table->id(); $table->string('name'); $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); diff --git a/database/migrations/2014_10_12_100000_create_password_resets_table.php b/database/migrations/2014_10_12_100000_create_password_resets_table.php deleted file mode 100644 index 0d5cb845..00000000 --- a/database/migrations/2014_10_12_100000_create_password_resets_table.php +++ /dev/null @@ -1,32 +0,0 @@ -<?php - -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Migrations\Migration; - -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'); - } -} diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index d432dff0..9bddee36 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -1,8 +1,8 @@ <?php -use Illuminate\Support\Facades\Schema; -use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; class CreateFailedJobsTable extends Migration { @@ -14,7 +14,7 @@ class CreateFailedJobsTable extends Migration public function up() { Schema::create('failed_jobs', function (Blueprint $table) { - $table->bigIncrements('id'); + $table->id(); $table->text('connection'); $table->text('queue'); $table->longText('payload'); diff --git a/package.json b/package.json index 9fcb8ee8..3729fb78 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ }, "devDependencies": { "axios": "^0.19", - "cross-env": "^5.1", - "laravel-mix": "^4.0.7", + "cross-env": "^7.0", + "laravel-mix": "^5.0.1", "lodash": "^4.17.13", - "resolve-url-loader": "^2.3.1", + "resolve-url-loader": "^3.1.0", "sass": "^1.15.2", - "sass-loader": "^7.1.0" + "sass-loader": "^8.0.0" } } diff --git a/phpunit.xml b/phpunit.xml index d562be80..383f71ef 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,13 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<phpunit backupGlobals="false" - backupStaticAttributes="false" - bootstrap="tests/bootstrap.php" - colors="true" - convertErrorsToExceptions="true" - convertNoticesToExceptions="true" - convertWarningsToExceptions="true" - processIsolation="false" - stopOnFailure="false"> +<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" + bootstrap="vendor/autoload.php" + colors="true"> <testsuites> <testsuite name="Unit"> <directory suffix="Test.php">./tests/Unit</directory> @@ -26,13 +21,10 @@ <server name="APP_ENV" value="testing"/> <server name="BCRYPT_ROUNDS" value="4"/> <server name="CACHE_DRIVER" value="array"/> - <server name="MAIL_DRIVER" value="array"/> + <server name="DB_CONNECTION" value="sqlite"/> + <server name="DB_DATABASE" value=":memory:"/> + <server name="MAIL_MAILER" value="array"/> <server name="QUEUE_CONNECTION" value="sync"/> <server name="SESSION_DRIVER" value="array"/> - <server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/> - <server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/> - <server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/> - <server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/> - <server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/> </php> </phpunit> diff --git a/public/.htaccess b/public/.htaccess index b75525be..3aec5e27 100644 --- a/public/.htaccess +++ b/public/.htaccess @@ -14,7 +14,7 @@ RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^ %1 [L,R=301] - # Handle Front Controller... + # Send Requests To Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index d11586d6..69225776 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -24,5 +24,5 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // broadcaster: 'pusher', // key: process.env.MIX_PUSHER_APP_KEY, // cluster: process.env.MIX_PUSHER_APP_CLUSTER, -// encrypted: true +// forceTLS: true // }); diff --git a/resources/lang/en/passwords.php b/resources/lang/en/passwords.php index f3b01a46..2345a56b 100644 --- a/resources/lang/en/passwords.php +++ b/resources/lang/en/passwords.php @@ -14,8 +14,9 @@ return [ */ 'reset' => 'Your password has been reset!', - 'sent' => 'We have e-mailed your password reset link!', + 'sent' => 'We have emailed your password reset link!', + 'throttled' => 'Please wait before retrying.', 'token' => 'This password reset token is invalid.', - 'user' => "We can't find a user with that e-mail address.", + 'user' => "We can't find a user with that email address.", ]; diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index e1d879f3..a65914f9 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -40,7 +40,7 @@ return [ 'dimensions' => 'The :attribute has invalid image dimensions.', 'distinct' => 'The :attribute field has a duplicate value.', 'email' => 'The :attribute must be a valid email address.', - 'ends_with' => 'The :attribute must end with one of the following: :values', + 'ends_with' => 'The :attribute must end with one of the following: :values.', 'exists' => 'The selected :attribute is invalid.', 'file' => 'The :attribute must be a file.', 'filled' => 'The :attribute field must have a value.', @@ -93,6 +93,7 @@ return [ 'not_in' => 'The selected :attribute is invalid.', 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', + 'password' => 'The password is incorrect.', 'present' => 'The :attribute field must be present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', @@ -109,7 +110,7 @@ return [ 'string' => 'The :attribute must be :size characters.', 'array' => 'The :attribute must contain :size items.', ], - 'starts_with' => 'The :attribute must start with one of the following: :values', + 'starts_with' => 'The :attribute must start with one of the following: :values.', 'string' => 'The :attribute must be a string.', 'timezone' => 'The :attribute must be a valid zone.', 'unique' => 'The :attribute has already been taken.', diff --git a/routes/api.php b/routes/api.php index c641ca5e..bcb8b189 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,6 +1,7 @@ <?php use Illuminate\Http\Request; +use Illuminate\Support\Facades\Route; /* |-------------------------------------------------------------------------- diff --git a/routes/channels.php b/routes/channels.php index f16a20b9..963b0d21 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,5 +1,7 @@ <?php +use Illuminate\Support\Facades\Broadcast; + /* |-------------------------------------------------------------------------- | Broadcast Channels diff --git a/routes/console.php b/routes/console.php index 75dd0cde..da55196d 100644 --- a/routes/console.php +++ b/routes/console.php @@ -1,6 +1,7 @@ <?php use Illuminate\Foundation\Inspiring; +use Illuminate\Support\Facades\Artisan; /* |-------------------------------------------------------------------------- diff --git a/routes/web.php b/routes/web.php index 810aa349..b1303973 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,7 @@ <?php +use Illuminate\Support\Facades\Route; + /* |-------------------------------------------------------------------------- | Web Routes diff --git a/tests/Feature/ExampleTest.php b/tests/Feature/ExampleTest.php index f31e495c..cdb51119 100644 --- a/tests/Feature/ExampleTest.php +++ b/tests/Feature/ExampleTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature; -use Tests\TestCase; use Illuminate\Foundation\Testing\RefreshDatabase; +use Tests\TestCase; class ExampleTest extends TestCase { diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php index e9fe19c6..358cfc88 100644 --- a/tests/Unit/ExampleTest.php +++ b/tests/Unit/ExampleTest.php @@ -2,8 +2,7 @@ namespace Tests\Unit; -use Tests\TestCase; -use Illuminate\Foundation\Testing\RefreshDatabase; +use PHPUnit\Framework\TestCase; class ExampleTest extends TestCase { diff --git a/tests/bootstrap.php b/tests/bootstrap.php deleted file mode 100644 index 5041c5a6..00000000 --- a/tests/bootstrap.php +++ /dev/null @@ -1,29 +0,0 @@ -<?php - -use Illuminate\Contracts\Console\Kernel; - -require_once __DIR__.'/../vendor/autoload.php'; - -/* -|-------------------------------------------------------------------------- -| Bootstrap The Test Environment -|-------------------------------------------------------------------------- -| -| You may specify console commands that execute once before your test is -| run. You are free to add your own additional commands or logic into -| this file as needed in order to help your test suite run quicker. -| -*/ - -$commands = [ - 'config:cache', - 'event:cache', -]; - -$app = require __DIR__.'/../bootstrap/app.php'; - -$console = tap($app->make(Kernel::class))->bootstrap(); - -foreach ($commands as $command) { - $console->call($command); -}