diff --git a/.github/workflows/pull-requests.yml b/.github/workflows/pull-requests.yml new file mode 100644 index 00000000..156b46eb --- /dev/null +++ b/.github/workflows/pull-requests.yml @@ -0,0 +1,13 @@ +name: Pull Requests + +on: + pull_request_target: + types: + - opened + +permissions: + pull-requests: write + +jobs: + uneditable: + uses: laravel/.github/.github/workflows/pull-requests.yml@main diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..9870c819 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests + +on: [push, pull_request] + +jobs: + tests: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite + coverage: none + + - name: Install Composer dependencies + run: composer install --prefer-dist --no-interaction + + - name: Copy environment file + run: cp .env.example .env + + - name: Generate app key + run: php artisan key:generate + + - name: Execute tests + run: vendor/bin/phpunit diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b9a70cb..2da613ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,48 @@ # Release Notes -## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.2...9.x) +## [Unreleased](https://github.com/laravel/laravel/compare/v9.1.8...9.x) + +## [v9.1.8](https://github.com/laravel/laravel/compare/v9.1.7...v9.1.8) - 2022-05-05 + +### Changed + +- Add local_domain option to smtp configuration by @bintzandt in https://github.com/laravel/laravel/pull/5877 +- Add specific test user in seeder by @driesvints in https://github.com/laravel/laravel/pull/5879 + +## [v9.1.7](https://github.com/laravel/laravel/compare/v9.1.6...v9.1.7) - 2022-05-03 + +### Changed + +- Deprecation log stack trace option by @driesvints in https://github.com/laravel/laravel/pull/5874 + +## [v9.1.6](https://github.com/laravel/laravel/compare/v9.1.5...v9.1.6) - 2022-04-20 + +### Changed + +- Move password lines into main translation file by @taylorotwell in https://github.com/laravel/laravel/commit/db0d052ece1c17c506633f4c9f5604b65e1cc3a4 +- Add missing maintenance to config by @ibrunotome in https://github.com/laravel/laravel/pull/5868 + +## [v9.1.5](https://github.com/laravel/laravel/compare/v9.1.4...v9.1.5) - 2022-04-12 + +### Changed + +- Rearrange route methods by @osbre in https://github.com/laravel/laravel/pull/5862 +- Add levels to handler by @taylorotwell in https://github.com/laravel/laravel/commit/a507e1424339633ce423729ec0ac49b99f0e57d7 + +## [v9.1.4](https://github.com/laravel/laravel/compare/v9.1.3...v9.1.4) - 2022-03-29 + +### Changed + +- Add encryption configuration by @taylorotwell in https://github.com/laravel/laravel/commit/f7b982ebdf7bd31eda9f05f901bd92ed32446156 + +## [v9.1.3](https://github.com/laravel/laravel/compare/v9.1.2...v9.1.3) - 2022-03-29 + +### Changed + +- Add an example to the class aliases by @nshiro in https://github.com/laravel/laravel/pull/5846 +- Add username in config to use with phpredis + ACL by @neoteknic in https://github.com/laravel/laravel/pull/5851 +- Remove "password" from validation lang by @mnastalski in https://github.com/laravel/laravel/pull/5856 +- Make authenticate session a route middleware by @taylorotwell in https://github.com/laravel/laravel/pull/5842 ## [v9.1.2](https://github.com/laravel/laravel/compare/v9.1.1...v9.1.2) - 2022-03-15 diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 8e7fbd1b..82a37e40 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -7,17 +7,26 @@ class Handler extends ExceptionHandler { + /** + * A list of exception types with their corresponding custom log levels. + * + * @var array, \Psr\Log\LogLevel::*> + */ + protected $levels = [ + // + ]; + /** * A list of the exception types that are not reported. * - * @var array> + * @var array> */ protected $dontReport = [ // ]; /** - * A list of the inputs that are never flashed for validation exceptions. + * A list of the inputs that are never flashed to the session on validation exceptions. * * @var array */ diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 4f18062a..c3be2544 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -33,7 +33,6 @@ class Kernel extends HttpKernel \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, \Illuminate\Session\Middleware\StartSession::class, - // \Illuminate\Session\Middleware\AuthenticateSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, \App\Http\Middleware\VerifyCsrfToken::class, \Illuminate\Routing\Middleware\SubstituteBindings::class, @@ -56,6 +55,7 @@ class Kernel extends HttpKernel protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, + 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 22b77e6e..51b351b0 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -8,7 +8,7 @@ class AuthServiceProvider extends ServiceProvider { /** - * The policy mappings for the application. + * The model to policy mappings for the application. * * @var array */ diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 45ca6685..ab8b2cf7 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -10,7 +10,7 @@ class EventServiceProvider extends ServiceProvider { /** - * The event listener mappings for the application. + * The event to listener mappings for the application. * * @var array> */ diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 0ba5291f..ea87f2e5 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -13,14 +13,14 @@ class RouteServiceProvider extends ServiceProvider /** * The path to the "home" route for your application. * - * This is used by Laravel authentication to redirect users after login. + * Typically, users are redirected here after authentication. * * @var string */ public const HOME = '/home'; /** - * Define your route model bindings, pattern filters, etc. + * Define your route model bindings, pattern filters, and other route configuration. * * @return void */ @@ -29,8 +29,8 @@ public function boot() $this->configureRateLimiting(); $this->routes(function () { - Route::prefix('api') - ->middleware('api') + Route::middleware('api') + ->prefix('api') ->group(base_path('routes/api.php')); Route::middleware('web') diff --git a/composer.json b/composer.json index d319f696..4ad84d00 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,6 @@ "require": { "php": "^8.1", "guzzlehttp/guzzle": "^7.2", - "fruitcake/laravel-cors": "dev-develop", "laravel/framework": "^10.0", "laravel/sanctum": "dev-develop", "laravel/tinker": "dev-develop" diff --git a/config/app.php b/config/app.php index b02c7f4b..ef76a7ed 100644 --- a/config/app.php +++ b/config/app.php @@ -125,6 +125,24 @@ 'cipher' => 'AES-256-CBC', + /* + |-------------------------------------------------------------------------- + | Maintenance Mode Driver + |-------------------------------------------------------------------------- + | + | These configuration options determine the driver used to determine and + | manage Laravel's "maintenance mode" status. The "cache" driver will + | allow maintenance mode to be controlled across multiple machines. + | + | Supported drivers: "file", "cache" + | + */ + + 'maintenance' => [ + 'driver' => 'file', + // 'store' => 'redis', + ], + /* |-------------------------------------------------------------------------- | Autoloaded Service Providers diff --git a/config/database.php b/config/database.php index 2a42e193..137ad18c 100644 --- a/config/database.php +++ b/config/database.php @@ -89,6 +89,8 @@ 'charset' => 'utf8', 'prefix' => '', 'prefix_indexes' => true, + // 'encrypt' => env('DB_ENCRYPT', 'yes'), + // 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'), ], ], diff --git a/config/logging.php b/config/logging.php index fefe0885..5aa1dbb7 100644 --- a/config/logging.php +++ b/config/logging.php @@ -30,7 +30,10 @@ | */ - 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'deprecations' => [ + 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + 'trace' => false, + ], /* |-------------------------------------------------------------------------- diff --git a/config/mail.php b/config/mail.php index 11bfe7e1..534395a3 100644 --- a/config/mail.php +++ b/config/mail.php @@ -42,6 +42,7 @@ 'username' => env('MAIL_USERNAME'), 'password' => env('MAIL_PASSWORD'), 'timeout' => null, + 'local_domain' => env('MAIL_EHLO_DOMAIN'), ], 'ses' => [ diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 71f673f0..c1c48a06 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -15,5 +15,10 @@ class DatabaseSeeder extends Seeder public function run() { // \App\Models\User::factory(10)->create(); + + // \App\Models\User::factory()->create([ + // 'name' => 'Test User', + // 'email' => 'test@example.com', + // ]); } } diff --git a/lang/en.json b/lang/en.json deleted file mode 100644 index 577680dd..00000000 --- a/lang/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "The :attribute must contain at least one letter.": "The :attribute must contain at least one letter.", - "The :attribute must contain at least one number.": "The :attribute must contain at least one number.", - "The :attribute must contain at least one symbol.": "The :attribute must contain at least one symbol.", - "The :attribute must contain at least one uppercase and one lowercase letter.": "The :attribute must contain at least one uppercase and one lowercase letter.", - "The given :attribute has appeared in a data leak. Please choose a different :attribute.": "The given :attribute has appeared in a data leak. Please choose a different :attribute." -} diff --git a/lang/en/validation.php b/lang/en/validation.php index 4707f1a6..724b5ace 100644 --- a/lang/en/validation.php +++ b/lang/en/validation.php @@ -100,7 +100,13 @@ '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.', + 'password' => [ + 'letters' => 'The :attribute must contain at least one letter.', + 'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.', + 'numbers' => 'The :attribute must contain at least one number.', + 'symbols' => 'The :attribute must contain at least one symbol.', + 'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different :attribute.', + ], 'present' => 'The :attribute field must be present.', 'prohibited' => 'The :attribute field is prohibited.', 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.',