From efe5d7158c40e710bbf58d6ad1b40ccccb58420d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sun, 11 Apr 2021 20:39:46 -0300 Subject: [PATCH 1/8] refactor: default structure to php 8, laravel 8 --- default-structure/Dockerfile | 2 +- default-structure/Dockerfile.testing | 2 +- .../app/Actions/Fortify/CreateNewUser.php | 41 + .../Fortify/PasswordValidationRules.php | 18 + .../app/Actions/Fortify/ResetUserPassword.php | 30 + .../Actions/Fortify/UpdateUserPassword.php | 35 + .../Fortify/UpdateUserProfileInformation.php | 61 + .../Http/Controllers/Auth/LoginController.php | 21 +- default-structure/app/Http/Kernel.php | 8 +- .../app/Http/Middleware/Authenticate.php | 2 +- .../Middleware/RedirectIfAuthenticated.php | 15 + default-structure/app/Models/User.php | 21 +- .../app/Providers/AuthServiceProvider.php | 5 + .../app/Providers/FortifyServiceProvider.php | 47 + .../app/Providers/RouteServiceProvider.php | 41 +- default-structure/composer.json | 28 +- default-structure/composer.lock | 2218 +++++++++-------- default-structure/config/app.php | 75 +- default-structure/config/auth.php | 16 +- default-structure/config/broadcasting.php | 36 +- default-structure/config/cache.php | 41 +- default-structure/config/cors.php | 45 + default-structure/config/database.php | 92 +- default-structure/config/filesystems.php | 55 +- default-structure/config/fortify.php | 145 ++ default-structure/config/geoip.php | 173 ++ default-structure/config/horizon.php | 81 +- default-structure/config/jwt.php | 303 --- default-structure/config/logging.php | 13 +- default-structure/config/queue.php | 11 +- default-structure/config/register.php | 12 - default-structure/config/sanctum.php | 50 + default-structure/config/session.php | 12 +- .../factories/AuthorizedDeviceFactory.php | 40 +- .../factories/LoginHistoryFactory.php | 21 +- .../database/factories/UserFactory.php | 83 +- ..._add_two_factor_columns_to_users_table.php | 38 + ...1_221810_add_uuid_to_failed_jobs_table.php | 32 + default-structure/docker-compose.develop.yml | 10 +- default-structure/docker-compose.testing.yml | 4 +- default-structure/php.ini | 4 +- default-structure/php.testing.ini | 5 +- modular-structure/Dockerfile | 6 +- 43 files changed, 2297 insertions(+), 1701 deletions(-) create mode 100644 default-structure/app/Actions/Fortify/CreateNewUser.php create mode 100644 default-structure/app/Actions/Fortify/PasswordValidationRules.php create mode 100644 default-structure/app/Actions/Fortify/ResetUserPassword.php create mode 100644 default-structure/app/Actions/Fortify/UpdateUserPassword.php create mode 100644 default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php create mode 100644 default-structure/app/Providers/FortifyServiceProvider.php create mode 100644 default-structure/config/cors.php create mode 100644 default-structure/config/fortify.php create mode 100644 default-structure/config/geoip.php delete mode 100644 default-structure/config/jwt.php delete mode 100644 default-structure/config/register.php create mode 100644 default-structure/config/sanctum.php create mode 100644 default-structure/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php create mode 100644 default-structure/database/migrations/2021_04_11_221810_add_uuid_to_failed_jobs_table.php diff --git a/default-structure/Dockerfile b/default-structure/Dockerfile index 295f5fc..cf0b68e 100644 --- a/default-structure/Dockerfile +++ b/default-structure/Dockerfile @@ -1,4 +1,4 @@ -FROM ibrunotome/php:7.4-fpm +FROM ibrunotome/php:8.0-fpm ARG COMPOSER_FLAGS diff --git a/default-structure/Dockerfile.testing b/default-structure/Dockerfile.testing index 13e02e2..de2a8e2 100644 --- a/default-structure/Dockerfile.testing +++ b/default-structure/Dockerfile.testing @@ -1,4 +1,4 @@ -FROM ibrunotome/php:7.4-fpm +FROM ibrunotome/php:8.0-fpm ARG COMPOSER_FLAGS diff --git a/default-structure/app/Actions/Fortify/CreateNewUser.php b/default-structure/app/Actions/Fortify/CreateNewUser.php new file mode 100644 index 0000000..cc593f3 --- /dev/null +++ b/default-structure/app/Actions/Fortify/CreateNewUser.php @@ -0,0 +1,41 @@ + ['required', 'string', 'max:255'], + 'email' => [ + 'required', + 'string', + 'email', + 'max:255', + Rule::unique(User::class), + ], + 'password' => $this->passwordRules(), + ])->validate(); + + return User::create([ + 'name' => $input['name'], + 'email' => $input['email'], + 'password' => Hash::make($input['password']), + ]); + } +} diff --git a/default-structure/app/Actions/Fortify/PasswordValidationRules.php b/default-structure/app/Actions/Fortify/PasswordValidationRules.php new file mode 100644 index 0000000..78ed8cf --- /dev/null +++ b/default-structure/app/Actions/Fortify/PasswordValidationRules.php @@ -0,0 +1,18 @@ + $this->passwordRules(), + ])->validate(); + + $user->forceFill([ + 'password' => Hash::make($input['password']), + ])->save(); + } +} diff --git a/default-structure/app/Actions/Fortify/UpdateUserPassword.php b/default-structure/app/Actions/Fortify/UpdateUserPassword.php new file mode 100644 index 0000000..690f324 --- /dev/null +++ b/default-structure/app/Actions/Fortify/UpdateUserPassword.php @@ -0,0 +1,35 @@ + ['required', 'string'], + 'password' => $this->passwordRules(), + ])->after(function ($validator) use ($user, $input) { + if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) { + $validator->errors()->add('current_password', __('The provided password does not match your current password.')); + } + })->validateWithBag('updatePassword'); + + $user->forceFill([ + 'password' => Hash::make($input['password']), + ])->save(); + } +} diff --git a/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php b/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php new file mode 100644 index 0000000..95e84ab --- /dev/null +++ b/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -0,0 +1,61 @@ + ['required', 'string', 'max:255'], + + 'email' => [ + 'required', + 'string', + 'email', + 'max:255', + Rule::unique('users')->ignore($user->id), + ], + ])->validateWithBag('updateProfileInformation'); + + if ($input['email'] !== $user->email && + $user instanceof MustVerifyEmail) { + $this->updateVerifiedUser($user, $input); + } else { + $user->forceFill([ + 'name' => $input['name'], + 'email' => $input['email'], + ])->save(); + } + } + + /** + * Update the given verified user's profile information. + * + * @param mixed $user + * @param array $input + * @return void + */ + protected function updateVerifiedUser($user, array $input) + { + $user->forceFill([ + 'name' => $input['name'], + 'email' => $input['email'], + 'email_verified_at' => null, + ])->save(); + + $user->sendEmailVerificationNotification(); + } +} diff --git a/default-structure/app/Http/Controllers/Auth/LoginController.php b/default-structure/app/Http/Controllers/Auth/LoginController.php index 00e4ff9..0bfbd27 100644 --- a/default-structure/app/Http/Controllers/Auth/LoginController.php +++ b/default-structure/app/Http/Controllers/Auth/LoginController.php @@ -140,7 +140,7 @@ private function getDeviceInfo(Request $request) $agent->setUserAgent($request->userAgent()); $agent->setHttpHeaders($request->headers); - $ipstack = new Ipstack($request->ip()); + $geoip = geoip($request->ip()); return [ 'user_id' => auth()->id(), @@ -150,16 +150,15 @@ private function getDeviceInfo(Request $request) 'platform_version' => $agent->version($agent->platform()), 'browser' => $agent->browser(), 'browser_version' => $agent->version($agent->browser()), - 'city' => $ipstack->city(), - 'region_code' => $ipstack->regionCode(), - 'region_name' => $ipstack->region(), - 'country_code' => $ipstack->countryCode(), - 'country_name' => $ipstack->country(), - 'continent_code' => $ipstack->continentCode(), - 'continent_name' => $ipstack->continent(), - 'latitude' => $ipstack->latitude(), - 'longitude' => $ipstack->longitude(), - 'zipcode' => $ipstack->zip(), + 'city' => $geoip->getAttribute('city'), + 'region_code' => $geoip->getAttribute('state'), + 'region_name' => $geoip->getAttribute('state_name'), + 'country_code' => $geoip->getAttribute('iso_code'), + 'country_name' => $geoip->getAttribute('country'), + 'continent_code' => $geoip->getAttribute('continent'), + 'latitude' => $geoip->getAttribute('lat'), + 'longitude' => $geoip->getAttribute('lon'), + 'zipcode' => $geoip->getAttribute('postal_code'), ]; } diff --git a/default-structure/app/Http/Kernel.php b/default-structure/app/Http/Kernel.php index ee2d46a..4207bac 100644 --- a/default-structure/app/Http/Kernel.php +++ b/default-structure/app/Http/Kernel.php @@ -2,6 +2,7 @@ namespace App\Http; +use App\Http\Middleware\Authenticate; use App\Http\Middleware\CheckForMaintenanceMode; use App\Http\Middleware\CheckTwoFactorAuthentication; use App\Http\Middleware\ForceAcceptJson; @@ -9,7 +10,6 @@ use App\Http\Middleware\SetLocale; use App\Http\Middleware\TrimStrings; use App\Http\Middleware\TrustProxies; -use Illuminate\Auth\Middleware\Authenticate; use Illuminate\Auth\Middleware\AuthenticateWithBasicAuth; use Illuminate\Auth\Middleware\Authorize; use Illuminate\Auth\Middleware\EnsureEmailIsVerified; @@ -21,6 +21,7 @@ use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Routing\Middleware\ValidateSignature; +use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful; class Kernel extends HttpKernel { @@ -48,7 +49,8 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'api' => [ - 'throttle:60,1', + EnsureFrontendRequestsAreStateful::class, + 'throttle:api', SubstituteBindings::class, ], ]; @@ -60,7 +62,7 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => Middleware\Authenticate::class, + 'auth' => Authenticate::class, 'auth.basic' => AuthenticateWithBasicAuth::class, 'bindings' => SubstituteBindings::class, 'cache.headers' => SetCacheHeaders::class, diff --git a/default-structure/app/Http/Middleware/Authenticate.php b/default-structure/app/Http/Middleware/Authenticate.php index 0eec715..bc3bb11 100644 --- a/default-structure/app/Http/Middleware/Authenticate.php +++ b/default-structure/app/Http/Middleware/Authenticate.php @@ -15,7 +15,7 @@ class Authenticate extends Middleware protected function redirectTo($request) { if (!$request->expectsJson()) { - return route('login'); + return url(env('SPA_URL') . '/login'); } } } diff --git a/default-structure/app/Http/Middleware/RedirectIfAuthenticated.php b/default-structure/app/Http/Middleware/RedirectIfAuthenticated.php index c0e9441..2dff588 100644 --- a/default-structure/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/default-structure/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,7 +2,10 @@ namespace App\Http\Middleware; +use App\Providers\RouteServiceProvider; use Closure; +use Illuminate\Http\Response; +use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated { @@ -16,6 +19,18 @@ class RedirectIfAuthenticated */ public function handle($request, Closure $next, $guard = null) { + $guards = empty($guards) ? [null] : $guards; + + foreach ($guards as $guard) { + if (Auth::guard($guard)->check()) { + if ($request->expectsJson()) { + return response()->json(['error' => 'Already authenticated.'], Response::HTTP_BAD_REQUEST); + } + + return redirect(RouteServiceProvider::HOME); + } + } + return $next($request); } } diff --git a/default-structure/app/Models/User.php b/default-structure/app/Models/User.php index 4a9fc00..b078bd0 100644 --- a/default-structure/app/Models/User.php +++ b/default-structure/app/Models/User.php @@ -10,10 +10,10 @@ use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Notifications\Notifiable; +use Laravel\Sanctum\HasApiTokens; use OwenIt\Auditing\Auditable; use OwenIt\Auditing\Contracts\Auditable as AuditableContract; use Spatie\Permission\Traits\HasRoles; -use Tymon\JWTAuth\Contracts\JWTSubject; /** * App\Models\User @@ -69,9 +69,10 @@ * @method static Builder|User whereUpdatedAt($value) * @mixin \Eloquent */ -class User extends Authenticatable implements JWTSubject, AuditableContract, HasLocalePreference, MustVerifyEmail +class User extends Authenticatable implements AuditableContract, HasLocalePreference, MustVerifyEmail { use Auditable; + use HasApiTokens; use HasRoles; use Notifiable; @@ -100,22 +101,6 @@ class User extends Authenticatable implements JWTSubject, AuditableContract, Has 'remember_token', ]; - /** - * {@inheritdoc} - */ - public function getJWTIdentifier() - { - return $this->getKey(); - } - - /** - * {@inheritdoc} - */ - public function getJWTCustomClaims() - { - return []; - } - public function receivesBroadcastNotificationsOn() { return 'users.' . $this->id; diff --git a/default-structure/app/Providers/AuthServiceProvider.php b/default-structure/app/Providers/AuthServiceProvider.php index 0e306e9..2b196a0 100644 --- a/default-structure/app/Providers/AuthServiceProvider.php +++ b/default-structure/app/Providers/AuthServiceProvider.php @@ -12,6 +12,7 @@ use App\Policies\PermissionPolicy; use App\Policies\RolePolicy; use App\Policies\UserPolicy; +use Illuminate\Auth\Notifications\ResetPassword; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; class AuthServiceProvider extends ServiceProvider @@ -27,5 +28,9 @@ class AuthServiceProvider extends ServiceProvider public function boot() { $this->registerPolicies(); + + ResetPassword::createUrlUsing(function ($user, string $token) { + return env('SPA_URL') . '/reset-password?token=' . $token; + }); } } diff --git a/default-structure/app/Providers/FortifyServiceProvider.php b/default-structure/app/Providers/FortifyServiceProvider.php new file mode 100644 index 0000000..dd29214 --- /dev/null +++ b/default-structure/app/Providers/FortifyServiceProvider.php @@ -0,0 +1,47 @@ +by($request->email.$request->ip()); + }); + + RateLimiter::for('two-factor', function (Request $request) { + return Limit::perMinute(5)->by($request->session()->get('login.id')); + }); + } +} diff --git a/default-structure/app/Providers/RouteServiceProvider.php b/default-structure/app/Providers/RouteServiceProvider.php index 9b04ee8..6b6ce97 100644 --- a/default-structure/app/Providers/RouteServiceProvider.php +++ b/default-structure/app/Providers/RouteServiceProvider.php @@ -2,21 +2,48 @@ namespace App\Providers; +use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Http\Request; +use Illuminate\Support\Facades\RateLimiter; use Illuminate\Support\Facades\Route; class RouteServiceProvider extends ServiceProvider { - public function map(): void + /** + * The path to the "home" route for your application. + * This is used by Laravel authentication to redirect users after login. + * + * @var string + */ + public const HOME = '/home'; + + /** + * Define your route model bindings, pattern filters, etc. + * + * @return void + */ + public function boot() { - $this->mapApiRoutes(); + $this->configureRateLimiting(); + + $this->routes(function () { + Route::prefix('api') + ->middleware('api') + ->namespace($this->namespace) + ->group(base_path('routes/api.php')); + }); } - protected function mapApiRoutes(): void + /** + * Configure the rate limiters for the application. + * + * @return void + */ + protected function configureRateLimiting() { - Route::prefix('api') - ->middleware('api') - ->namespace($this->namespace) - ->group(base_path('routes/api.php')); + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + }); } } diff --git a/default-structure/composer.json b/default-structure/composer.json index b9e35af..d5c404c 100644 --- a/default-structure/composer.json +++ b/default-structure/composer.json @@ -13,34 +13,32 @@ ], "license": "MIT", "require": { - "php": "^7.4", + "php": "^8.0", "ext-bcmath": "*", "ext-json": "*", "ext-pcntl": "*", "ext-pdo": "*", "fideloper/proxy": "^4.1", - "fntneves/laravel-transactional-events": "^1.8", - "ibrunotome/google2fa-laravel": "^1.0", + "fntneves/laravel-transactional-events": "^2.0", "jenssegers/agent": "^2.6", - "laravel/framework": "^7.24", - "laravel/horizon": "^4.0", - "laravel/slack-notification-channel": "^2.0", + "laravel/fortify": "^1.7", + "laravel/framework": "^8.0", + "laravel/horizon": "^5.0", + "laravel/sanctum": "^2.9", "laravel/tinker": "^2.0", - "laravel/ui": "^2.2", "league/flysystem-aws-s3-v3": "^1.0", - "owen-it/laravel-auditing": "^10.0", + "owen-it/laravel-auditing": "^12.0", "spatie/laravel-permission": "^3.0", "spatie/laravel-query-builder": "^3.0", - "sudiptpa/ipstack": "^1.3", - "tymon/jwt-auth": "1.0.0" + "torann/geoip": "^3.0" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.7", - "facade/ignition": "^2.0", - "fzaninotto/faker": "^1.9.1", + "facade/ignition": "^2.3.6", + "fakerphp/faker": "^1.13.0", "mockery/mockery": "^1.0", - "nunomaduro/collision": "^4.1", - "nunomaduro/phpinsights": "^1.0", + "nunomaduro/collision": "^5.0", + "nunomaduro/phpinsights": "dev-master", "phpunit/phpunit": "^9.0" }, "autoload": { @@ -78,6 +76,6 @@ "sort-packages": true, "optimize-autoloader": true }, - "minimum-stability": "RC", + "minimum-stability": "stable", "prefer-stable": true } diff --git a/default-structure/composer.lock b/default-structure/composer.lock index 0a9e9e1..8c85c90 100644 --- a/default-structure/composer.lock +++ b/default-structure/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0569f03234896555097fb4881ebf1292", + "content-hash": "1376e5ea6090286070845fe2e783c3e4", "packages": [ { "name": "aws/aws-sdk-php", @@ -96,6 +96,59 @@ }, "time": "2021-04-09T18:13:02+00:00" }, + { + "name": "bacon/bacon-qr-code", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/3e9d791b67d0a2912922b7b7c7312f4b37af41e4", + "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4", + "shasum": "" + }, + "require": { + "dasprid/enum": "^1.0.3", + "ext-iconv": "*", + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phly/keep-a-changelog": "^1.4", + "phpunit/phpunit": "^7 | ^8 | ^9", + "squizlabs/php_codesniffer": "^3.4" + }, + "suggest": { + "ext-imagick": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-4": { + "BaconQrCode\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "https://dasprids.de/", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "support": { + "issues": "https://github.com/Bacon/BaconQrCode/issues", + "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.3" + }, + "time": "2020-10-30T02:02:47+00:00" + }, { "name": "brick/math", "version": "0.9.2", @@ -153,63 +206,51 @@ "time": "2021-01-20T22:51:39+00:00" }, { - "name": "cakephp/chronos", - "version": "2.1.2", + "name": "dasprid/enum", + "version": "1.0.3", "source": { "type": "git", - "url": "https://github.com/cakephp/chronos.git", - "reference": "1d187c71587c97520c00491f626e0f255144953e" + "url": "https://github.com/DASPRiD/Enum.git", + "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/1d187c71587c97520c00491f626e0f255144953e", - "reference": "1d187c71587c97520c00491f626e0f255144953e", + "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2", + "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2", "shasum": "" }, - "require": { - "php": ">=7.2" - }, "require-dev": { - "cakephp/cakephp-codesniffer": "^4.0", - "phpunit/phpunit": "^8.0 || ^9.0" + "phpunit/phpunit": "^7 | ^8 | ^9", + "squizlabs/php_codesniffer": "^3.4" }, "type": "library", "autoload": { "psr-4": { - "Cake\\Chronos\\": "src/" - }, - "files": [ - "src/carbon_compat.php" - ] + "DASPRiD\\Enum\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - }, - { - "name": "The CakePHP Team", - "homepage": "http://cakephp.org" + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "https://dasprids.de/", + "role": "Developer" } ], - "description": "A simple API extension for DateTime.", - "homepage": "http://cakephp.org", + "description": "PHP 7.1 enum implementation", "keywords": [ - "date", - "datetime", - "time" + "enum", + "map" ], "support": { - "irc": "irc://irc.freenode.org/cakephp", - "issues": "https://github.com/cakephp/chronos/issues", - "source": "https://github.com/cakephp/chronos" + "issues": "https://github.com/DASPRiD/Enum/issues", + "source": "https://github.com/DASPRiD/Enum/tree/1.0.3" }, - "time": "2021-04-07T01:06:46+00:00" + "time": "2020-10-02T16:03:48+00:00" }, { "name": "doctrine/inflector", @@ -388,30 +429,32 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v2.3.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2" + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", "shasum": "" }, "require": { - "php": "^7.0|^8.0" + "php": "^7.2|^8.0", + "webmozart/assert": "^1.7.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0" + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12.7", + "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -422,11 +465,6 @@ "MIT" ], "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, { "name": "Chris Tankersley", "email": "chris@ctankersley.com", @@ -440,7 +478,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0" }, "funding": [ { @@ -448,7 +486,7 @@ "type": "github" } ], - "time": "2020-10-13T00:52:37+00:00" + "time": "2020-11-24T19:55:57+00:00" }, { "name": "egulias/email-validator", @@ -578,26 +616,26 @@ }, { "name": "fntneves/laravel-transactional-events", - "version": "1.8.11", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/fntneves/laravel-transactional-events.git", - "reference": "86627e50c3279ae0c8807a27518573bb11e67069" + "reference": "af0665a6a4fda7971716279db7e9a9119926d2ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fntneves/laravel-transactional-events/zipball/86627e50c3279ae0c8807a27518573bb11e67069", - "reference": "86627e50c3279ae0c8807a27518573bb11e67069", + "url": "https://api.github.com/repos/fntneves/laravel-transactional-events/zipball/af0665a6a4fda7971716279db7e9a9119926d2ef", + "reference": "af0665a6a4fda7971716279db7e9a9119926d2ef", "shasum": "" }, "require": { - "illuminate/database": "~5.8.0|^6.0|^7.0", - "illuminate/events": "~5.8.0|^6.0|^7.0", - "illuminate/support": "~5.8.0|^6.0|^7.0", + "illuminate/database": "^8.0", + "illuminate/events": "^8.0", + "illuminate/support": "^8.0", "loophp/phptree": "^2.5" }, "require-dev": { - "orchestra/testbench": "~3.8.0|~4.0|^5.0" + "orchestra/testbench": "^6.0" }, "type": "library", "extra": { @@ -628,9 +666,75 @@ "description": "Transaction-aware Event Dispatcher for Laravel", "support": { "issues": "https://github.com/fntneves/laravel-transactional-events/issues", - "source": "https://github.com/fntneves/laravel-transactional-events/tree/1.8.11" + "source": "https://github.com/fntneves/laravel-transactional-events/tree/2.0.1" + }, + "time": "2020-10-13T12:21:49+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "phpoption/phpoption": "^1.7.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" }, - "time": "2020-10-13T12:19:34+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2020-04-13T13:17:36+00:00" }, { "name": "guzzlehttp/guzzle", @@ -865,78 +969,6 @@ }, "time": "2021-03-21T16:25:00+00:00" }, - { - "name": "ibrunotome/google2fa-laravel", - "version": "v1.0.4", - "source": { - "type": "git", - "url": "https://github.com/ibrunotome/google2fa-laravel.git", - "reference": "7fea2255ae7f752f2144eec93bb8ecbc9255da7b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ibrunotome/google2fa-laravel/zipball/7fea2255ae7f752f2144eec93bb8ecbc9255da7b", - "reference": "7fea2255ae7f752f2144eec93bb8ecbc9255da7b", - "shasum": "" - }, - "require": { - "laravel/framework": ">=5.2", - "php": ">=5.4", - "pragmarx/google2fa": "~5.0" - }, - "require-dev": { - "orchestra/testbench-browser-kit": "~3.4|~3.5|~3.6", - "phpunit/phpunit": "~5|~6|~7|~8" - }, - "suggest": { - "bacon/bacon-qr-code": "Required to generate inline QR Codes.", - "pragmarx/recovery": "Generate recovery codes." - }, - "type": "library", - "extra": { - "component": "package", - "frameworks": [ - "Laravel" - ], - "laravel": { - "providers": [ - "PragmaRX\\Google2FALaravel\\ServiceProvider" - ], - "aliases": { - "Google2FA": "PragmaRX\\Google2FALaravel\\Facade" - } - } - }, - "autoload": { - "psr-4": { - "PragmaRX\\Google2FALaravel\\": "src/", - "PragmaRX\\Google2FALaravel\\Tests\\": "tests/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Antonio Carlos Ribeiro", - "email": "acr@antoniocarlosribeiro.com", - "role": "Creator & Designer" - } - ], - "description": "The pragmarx/google2fa with cache store instead sessions", - "keywords": [ - "Authentication", - "Two Factor Authentication", - "google2fa", - "laravel" - ], - "support": { - "issues": "https://github.com/ibrunotome/google2fa-laravel/issues", - "source": "https://github.com/ibrunotome/google2fa-laravel/tree/master" - }, - "time": "2020-05-17T21:40:57+00:00" - }, { "name": "jaybizzle/crawler-detect", "version": "v1.2.105", @@ -1072,23 +1104,86 @@ ], "time": "2020-06-13T08:05:20+00:00" }, + { + "name": "laravel/fortify", + "version": "v1.7.9", + "source": { + "type": "git", + "url": "https://github.com/laravel/fortify.git", + "reference": "9ba71f3e448ae44370bdfe72f19952e23b4d6191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/fortify/zipball/9ba71f3e448ae44370bdfe72f19952e23b4d6191", + "reference": "9ba71f3e448ae44370bdfe72f19952e23b4d6191", + "shasum": "" + }, + "require": { + "bacon/bacon-qr-code": "^2.0", + "ext-json": "*", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "pragmarx/google2fa": "^7.0|^8.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + }, + "laravel": { + "providers": [ + "Laravel\\Fortify\\FortifyServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Laravel\\Fortify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "Backend controllers and scaffolding for Laravel authentication.", + "keywords": [ + "auth", + "laravel" + ], + "support": { + "issues": "https://github.com/laravel/fortify/issues", + "source": "https://github.com/laravel/fortify" + }, + "time": "2021-03-30T21:12:39+00:00" + }, { "name": "laravel/framework", - "version": "v7.30.4", + "version": "v8.36.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3" + "reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9dd38140dc2924daa1a020a3d7a45f9ceff03df3", - "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3", + "url": "https://api.github.com/repos/laravel/framework/zipball/0debd8ad6b5aa1f61ccc73910adf049af4ca0444", + "reference": "0debd8ad6b5aa1f61ccc73910adf049af4ca0444", "shasum": "" }, "require": { "doctrine/inflector": "^1.4|^2.0", - "dragonmantank/cron-expression": "^2.3.1", + "dragonmantank/cron-expression": "^3.0.2", "egulias/email-validator": "^2.1.10", "ext-json": "*", "ext-mbstring": "*", @@ -1098,23 +1193,22 @@ "monolog/monolog": "^2.0", "nesbot/carbon": "^2.31", "opis/closure": "^3.6", - "php": "^7.2.5|^8.0", + "php": "^7.3|^8.0", "psr/container": "^1.0", "psr/simple-cache": "^1.0", - "ramsey/uuid": "^3.7|^4.0", + "ramsey/uuid": "^4.0", "swiftmailer/swiftmailer": "^6.0", - "symfony/console": "^5.0", - "symfony/error-handler": "^5.0", - "symfony/finder": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/mime": "^5.0", - "symfony/polyfill-php73": "^1.17", - "symfony/process": "^5.0", - "symfony/routing": "^5.0", - "symfony/var-dumper": "^5.0", + "symfony/console": "^5.1.4", + "symfony/error-handler": "^5.1.4", + "symfony/finder": "^5.1.4", + "symfony/http-foundation": "^5.1.4", + "symfony/http-kernel": "^5.1.4", + "symfony/mime": "^5.1.4", + "symfony/process": "^5.1.4", + "symfony/routing": "^5.1.4", + "symfony/var-dumper": "^5.1.4", "tijsverkoyen/css-to-inline-styles": "^2.2.2", - "vlucas/phpdotenv": "^4.0", + "vlucas/phpdotenv": "^5.2", "voku/portable-ascii": "^1.4.8" }, "conflict": { @@ -1128,6 +1222,7 @@ "illuminate/broadcasting": "self.version", "illuminate/bus": "self.version", "illuminate/cache": "self.version", + "illuminate/collections": "self.version", "illuminate/config": "self.version", "illuminate/console": "self.version", "illuminate/container": "self.version", @@ -1140,6 +1235,7 @@ "illuminate/hashing": "self.version", "illuminate/http": "self.version", "illuminate/log": "self.version", + "illuminate/macroable": "self.version", "illuminate/mail": "self.version", "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", @@ -1156,21 +1252,21 @@ }, "require-dev": { "aws/aws-sdk-php": "^3.155", - "doctrine/dbal": "^2.6", + "doctrine/dbal": "^2.6|^3.0", "filp/whoops": "^2.8", - "guzzlehttp/guzzle": "^6.3.1|^7.0.1", + "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "~1.3.3|^1.4.2", - "moontoast/math": "^1.1", - "orchestra/testbench-core": "^5.8", + "mockery/mockery": "^1.4.2", + "orchestra/testbench-core": "^6.8", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.4|^9.3.3", + "phpunit/phpunit": "^8.5.8|^9.3.3", "predis/predis": "^1.1.1", - "symfony/cache": "^5.0" + "symfony/cache": "^5.1.4" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "brianium/paratest": "Required to run tests in parallel (^6.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-memcached": "Required to use the memcache cache driver.", @@ -1179,37 +1275,42 @@ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "filp/whoops": "Required for friendly error pages in development (^2.8).", - "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.3.1|^7.0.1).", + "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", - "mockery/mockery": "Required to use mocking (~1.3.3|^1.4.2).", - "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "mockery/mockery": "Required to use mocking (^1.4.2).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.3.3).", + "phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.0).", - "symfony/filesystem": "Required to create relative storage directory symbolic links (^5.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { "files": [ + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], "psr-4": { - "Illuminate\\": "src/Illuminate/" + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -1232,39 +1333,39 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-01-21T14:10:48+00:00" + "time": "2021-04-07T12:37:22+00:00" }, { "name": "laravel/horizon", - "version": "v4.3.5", + "version": "v5.7.5", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "b3fba0daaaaf5e84197b06dd25f3b27bb7301171" + "reference": "9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/b3fba0daaaaf5e84197b06dd25f3b27bb7301171", - "reference": "b3fba0daaaaf5e84197b06dd25f3b27bb7301171", + "url": "https://api.github.com/repos/laravel/horizon/zipball/9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8", + "reference": "9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8", "shasum": "" }, "require": { - "cakephp/chronos": "^2.0", "ext-json": "*", "ext-pcntl": "*", "ext-posix": "*", - "illuminate/contracts": "^7.0", - "illuminate/queue": "^7.0", - "illuminate/support": "^7.0", - "php": "^7.2", - "ramsey/uuid": "^3.5|^4.0", + "illuminate/contracts": "^8.17", + "illuminate/queue": "^8.17", + "illuminate/support": "^8.17", + "nesbot/carbon": "^2.17", + "php": "^7.3|^8.0", + "ramsey/uuid": "^4.0", "symfony/error-handler": "^5.0", "symfony/process": "^5.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^5.0", - "phpunit/phpunit": "^8.0", + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.0", "predis/predis": "^1.1" }, "suggest": { @@ -1274,7 +1375,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" }, "laravel": { "providers": [ @@ -1307,32 +1408,35 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/4.x" + "source": "https://github.com/laravel/horizon/tree/v5.7.5" }, - "time": "2020-09-08T13:19:23+00:00" + "time": "2021-04-06T14:17:52+00:00" }, { - "name": "laravel/slack-notification-channel", - "version": "v2.3.1", + "name": "laravel/sanctum", + "version": "v2.9.4", "source": { "type": "git", - "url": "https://github.com/laravel/slack-notification-channel.git", - "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20" + "url": "https://github.com/laravel/sanctum.git", + "reference": "dd84a9141012c5509922df0c72866110f45026cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", - "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", + "url": "https://api.github.com/repos/laravel/sanctum/zipball/dd84a9141012c5509922df0c72866110f45026cb", + "reference": "dd84a9141012c5509922df0c72866110f45026cb", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0|^7.0", - "illuminate/notifications": "~5.8.0|^6.0|^7.0|^8.0", - "php": "^7.1.3|^8.0" + "ext-json": "*", + "illuminate/contracts": "^6.9|^7.0|^8.0", + "illuminate/database": "^6.9|^7.0|^8.0", + "illuminate/support": "^6.9|^7.0|^8.0", + "php": "^7.2|^8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0" + "orchestra/testbench": "^4.0|^5.0|^6.0", + "phpunit/phpunit": "^8.0|^9.3" }, "type": "library", "extra": { @@ -1341,13 +1445,13 @@ }, "laravel": { "providers": [ - "Illuminate\\Notifications\\SlackChannelServiceProvider" + "Laravel\\Sanctum\\SanctumServiceProvider" ] } }, "autoload": { "psr-4": { - "Illuminate\\Notifications\\": "src/" + "Laravel\\Sanctum\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1360,17 +1464,17 @@ "email": "taylor@laravel.com" } ], - "description": "Slack Notification Channel for laravel.", + "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", "keywords": [ + "auth", "laravel", - "notifications", - "slack" + "sanctum" ], "support": { - "issues": "https://github.com/laravel/slack-notification-channel/issues", - "source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.1" + "issues": "https://github.com/laravel/sanctum/issues", + "source": "https://github.com/laravel/sanctum" }, - "time": "2021-01-26T20:04:54+00:00" + "time": "2021-04-06T14:32:48+00:00" }, { "name": "laravel/tinker", @@ -1441,170 +1545,38 @@ "time": "2021-03-02T16:53:12+00:00" }, { - "name": "laravel/ui", - "version": "v2.5.0", + "name": "league/commonmark", + "version": "1.5.8", "source": { "type": "git", - "url": "https://github.com/laravel/ui.git", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d" + "url": "https://github.com/thephpleague/commonmark.git", + "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/d01a705763c243b07be795e9d1bb47f89260f73d", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", + "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", "shasum": "" }, "require": { - "illuminate/console": "^7.0", - "illuminate/filesystem": "^7.0", - "illuminate/support": "^7.0", - "php": "^7.2.5|^8.0" + "ext-mbstring": "*", + "php": "^7.1 || ^8.0" }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Laravel\\Ui\\UiServiceProvider" - ] - } + "conflict": { + "scrutinizer/ocular": "1.7.*" }, - "autoload": { - "psr-4": { - "Laravel\\Ui\\": "src/", - "Illuminate\\Foundation\\Auth\\": "auth-backend/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Laravel UI utilities and presets.", - "keywords": [ - "laravel", - "ui" - ], - "support": { - "issues": "https://github.com/laravel/ui/issues", - "source": "https://github.com/laravel/ui/tree/v2.5.0" - }, - "time": "2020-11-03T19:45:19+00:00" - }, - { - "name": "lcobucci/jwt", - "version": "3.4.5", - "source": { - "type": "git", - "url": "https://github.com/lcobucci/jwt.git", - "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/511629a54465e89a31d3d7e4cf0935feab8b14c1", - "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "ext-openssl": "*", - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "mikey179/vfsstream": "~1.5", - "phpmd/phpmd": "~2.2", - "phpunit/php-invoker": "~1.1", - "phpunit/phpunit": "^5.7 || ^7.3", - "squizlabs/php_codesniffer": "~2.3" - }, - "suggest": { - "lcobucci/clock": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "autoload": { - "psr-4": { - "Lcobucci\\JWT\\": "src" - }, - "files": [ - "compat/class-aliases.php", - "compat/json-exception-polyfill.php", - "compat/lcobucci-clock-polyfill.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Luís Otávio Cobucci Oblonczyk", - "email": "lcobucci@gmail.com", - "role": "Developer" - } - ], - "description": "A simple library to work with JSON Web Token and JSON Web Signature", - "keywords": [ - "JWS", - "jwt" - ], - "support": { - "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/3.4.5" - }, - "funding": [ - { - "url": "https://github.com/lcobucci", - "type": "github" - }, - { - "url": "https://www.patreon.com/lcobucci", - "type": "patreon" - } - ], - "time": "2021-02-16T09:40:01+00:00" - }, - { - "name": "league/commonmark", - "version": "1.5.8", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/commonmark.git", - "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", - "reference": "08fa59b8e4e34ea8a773d55139ae9ac0e0aecbaf", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" - }, - "require-dev": { - "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.2", - "erusev/parsedown": "~1.0", - "ext-json": "*", - "github/gfm": "0.29.0", - "michelf/php-markdown": "~1.4", - "mikehaertl/php-shellcommand": "^1.4", - "phpstan/phpstan": "^0.12", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", - "scrutinizer/ocular": "^1.5", - "symfony/finder": "^4.2" + "require-dev": { + "cebe/markdown": "~1.0", + "commonmark/commonmark.js": "0.29.2", + "erusev/parsedown": "~1.0", + "ext-json": "*", + "github/gfm": "0.29.0", + "michelf/php-markdown": "~1.4", + "mikehaertl/php-shellcommand": "^1.4", + "phpstan/phpstan": "^0.12", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", + "scrutinizer/ocular": "^1.5", + "symfony/finder": "^4.2" }, "bin": [ "bin/commonmark" @@ -2160,73 +2132,6 @@ }, "time": "2020-07-31T21:01:56+00:00" }, - { - "name": "namshi/jose", - "version": "7.2.3", - "source": { - "type": "git", - "url": "https://github.com/namshi/jose.git", - "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/namshi/jose/zipball/89a24d7eb3040e285dd5925fcad992378b82bcff", - "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff", - "shasum": "" - }, - "require": { - "ext-date": "*", - "ext-hash": "*", - "ext-json": "*", - "ext-pcre": "*", - "ext-spl": "*", - "php": ">=5.5", - "symfony/polyfill-php56": "^1.0" - }, - "require-dev": { - "phpseclib/phpseclib": "^2.0", - "phpunit/phpunit": "^4.5|^5.0", - "satooshi/php-coveralls": "^1.0" - }, - "suggest": { - "ext-openssl": "Allows to use OpenSSL as crypto engine.", - "phpseclib/phpseclib": "Allows to use Phpseclib as crypto engine, use version ^2.0." - }, - "type": "library", - "autoload": { - "psr-4": { - "Namshi\\JOSE\\": "src/Namshi/JOSE/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alessandro Nadalin", - "email": "alessandro.nadalin@gmail.com" - }, - { - "name": "Alessandro Cinelli (cirpo)", - "email": "alessandro.cinelli@gmail.com" - } - ], - "description": "JSON Object Signing and Encryption library for PHP.", - "keywords": [ - "JSON Web Signature", - "JSON Web Token", - "JWS", - "json", - "jwt", - "token" - ], - "support": { - "issues": "https://github.com/namshi/jose/issues", - "source": "https://github.com/namshi/jose/tree/master" - }, - "time": "2016-12-05T07:27:31+00:00" - }, { "name": "nesbot/carbon", "version": "2.46.0", @@ -2443,28 +2348,28 @@ }, { "name": "owen-it/laravel-auditing", - "version": "v10.0.0", + "version": "v12.0.0", "source": { "type": "git", "url": "https://github.com/owen-it/laravel-auditing.git", - "reference": "50b0d9bc8d47a6fd873427c012c6710850e73a34" + "reference": "5659c736f17aa75805b60c0d0a23783f3bf5c2a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owen-it/laravel-auditing/zipball/50b0d9bc8d47a6fd873427c012c6710850e73a34", - "reference": "50b0d9bc8d47a6fd873427c012c6710850e73a34", + "url": "https://api.github.com/repos/owen-it/laravel-auditing/zipball/5659c736f17aa75805b60c0d0a23783f3bf5c2a1", + "reference": "5659c736f17aa75805b60c0d0a23783f3bf5c2a1", "shasum": "" }, "require": { - "illuminate/console": "^5.8|^6.0|^7.0", - "illuminate/database": "^5.8|^6.0|^7.0", - "illuminate/filesystem": "^5.8|^6.0|^7.0", - "php": ">=7.2.5" + "illuminate/console": "^6.0|^7.0|^8.0", + "illuminate/database": "^6.0|^7.0|^8.0", + "illuminate/filesystem": "^6.0|^7.0|^8.0", + "php": "^7.3|^8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^3.8", - "phpunit/phpunit": "^8.0", + "orchestra/testbench": "^4.0", + "phpunit/phpunit": "^9.0", "ramsey/uuid": "^3.0" }, "suggest": { @@ -2526,7 +2431,7 @@ "issues": "https://github.com/owen-it/laravel-auditing/issues", "source": "https://github.com/owen-it/laravel-auditing" }, - "time": "2020-03-23T22:49:02+00:00" + "time": "2020-12-15T19:19:43+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -2595,56 +2500,6 @@ }, "time": "2020-12-06T15:14:20+00:00" }, - { - "name": "paragonie/random_compat", - "version": "v9.99.100", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", - "shasum": "" - }, - "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2020-10-15T08:29:30+00:00" - }, { "name": "phpoption/phpoption", "version": "1.7.5", @@ -2716,38 +2571,30 @@ }, { "name": "pragmarx/google2fa", - "version": "v5.0.0", + "version": "8.0.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa.git", - "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4" + "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/17c969c82f427dd916afe4be50bafc6299aef1b4", - "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/26c4c5cf30a2844ba121760fd7301f8ad240100b", + "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "~1.0|~2.0", - "paragonie/random_compat": ">=1", - "php": ">=5.4", - "symfony/polyfill-php56": "~1.2" + "paragonie/constant_time_encoding": "^1.0|^2.0", + "php": "^7.1|^8.0" }, "require-dev": { - "phpunit/phpunit": "~4|~5|~6" + "phpstan/phpstan": "^0.12.18", + "phpunit/phpunit": "^7.5.15|^8.5|^9.0" }, "type": "library", - "extra": { - "component": "package", - "branch-alias": { - "dev-master": "2.0-dev" - } - }, "autoload": { "psr-4": { - "PragmaRX\\Google2FA\\": "src/", - "PragmaRX\\Google2FA\\Tests\\": "tests/" + "PragmaRX\\Google2FA\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2770,9 +2617,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa/issues", - "source": "https://github.com/antonioribeiro/google2fa/tree/master" + "source": "https://github.com/antonioribeiro/google2fa/tree/8.0.0" }, - "time": "2019-03-19T22:44:16+00:00" + "time": "2020-04-05T10:47:18+00:00" }, { "name": "psr/container", @@ -3514,62 +3361,6 @@ ], "time": "2020-11-26T14:51:30+00:00" }, - { - "name": "sudiptpa/ipstack", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sudiptpa/ipstack.git", - "reference": "381471a275d459599f243cd43c7d8761635b488f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sudiptpa/ipstack/zipball/381471a275d459599f243cd43c7d8761635b488f", - "reference": "381471a275d459599f243cd43c7d8761635b488f", - "shasum": "" - }, - "require": { - "php": "~7.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpro/grumphp": "^0.14.0", - "phpunit/phpunit": "~6.0", - "squizlabs/php_codesniffer": "^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Sujip\\Ipstack\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sujip Thapa", - "email": "sudiptpa@gmail.com" - } - ], - "description": "A simple package for IP to Location implementation with PHP.", - "keywords": [ - "geoip", - "ip to location", - "ipstack" - ], - "support": { - "issues": "https://github.com/sudiptpa/ipstack/issues", - "source": "https://github.com/sudiptpa/ipstack/tree/master" - }, - "time": "2018-07-18T16:10:08+00:00" - }, { "name": "swiftmailer/swiftmailer", "version": "v6.2.7", @@ -5007,32 +4798,40 @@ "time": "2021-01-22T09:19:47+00:00" }, { - "name": "symfony/polyfill-php56", - "version": "v1.20.0", + "name": "symfony/polyfill-php72", + "version": "v1.22.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php56.git", - "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675" + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", - "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", "shasum": "" }, "require": { "php": ">=7.1" }, - "type": "metapackage", + "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.22-dev" }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" } }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php72\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -5047,7 +4846,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", "homepage": "https://symfony.com", "keywords": [ "compatibility", @@ -5056,7 +4855,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php56/tree/v1.20.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" }, "funding": [ { @@ -5072,20 +4871,20 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2021-01-07T16:49:33+00:00" }, { - "name": "symfony/polyfill-php72", + "name": "symfony/polyfill-php73", "version": "v1.22.1", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9" + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", - "reference": "cc6e6f9b39fe8075b3dabfbaf5b5f645ae1340c9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", "shasum": "" }, "require": { @@ -5103,89 +4902,13 @@ }, "autoload": { "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "Symfony\\Polyfill\\Php73\\": "" }, "files": [ "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.22.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-01-07T16:49:33+00:00" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.22.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.22-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" + ], + "classmap": [ + "Resources/stubs" ] }, "notification-url": "https://packagist.org/downloads/", @@ -5939,122 +5662,120 @@ "time": "2020-07-13T06:12:54+00:00" }, { - "name": "tymon/jwt-auth", - "version": "1.0.0", + "name": "torann/geoip", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/tymondesigns/jwt-auth.git", - "reference": "d4cf9fd2b98790712d3e6cd1094e5ff018431f19" + "url": "https://github.com/Torann/laravel-geoip.git", + "reference": "f16d5df66ecb6ba4ffaef52abef519fbc19596d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/d4cf9fd2b98790712d3e6cd1094e5ff018431f19", - "reference": "d4cf9fd2b98790712d3e6cd1094e5ff018431f19", + "url": "https://api.github.com/repos/Torann/laravel-geoip/zipball/f16d5df66ecb6ba4ffaef52abef519fbc19596d3", + "reference": "f16d5df66ecb6ba4ffaef52abef519fbc19596d3", "shasum": "" }, "require": { - "illuminate/auth": "^5.2|^6|^7", - "illuminate/contracts": "^5.2|^6|^7", - "illuminate/http": "^5.2|^6|^7", - "illuminate/support": "^5.2|^6|^7", - "lcobucci/jwt": "^3.2", - "namshi/jose": "^7.0", - "nesbot/carbon": "^1.0|^2.0", - "php": "^5.5.9|^7.0" + "illuminate/cache": "^8.0", + "illuminate/console": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.2 || ^8.0" }, "require-dev": { - "illuminate/console": "^5.2|^6|^7", - "illuminate/database": "^5.2|^6|^7", - "illuminate/routing": "^5.2|^6|^7", - "mockery/mockery": ">=0.9.9", - "phpunit/phpunit": "~4.8|~6.0" + "geoip2/geoip2": "~2.1", + "mockery/mockery": "^1.3", + "phpstan/phpstan": "^0.12.14", + "phpunit/phpunit": "^8.0", + "squizlabs/php_codesniffer": "^3.5", + "vlucas/phpdotenv": "^5.0" + }, + "suggest": { + "geoip2/geoip2": "Required to use the MaxMind database or web service with GeoIP (~2.1).", + "monolog/monolog": "Allows for storing location not found errors to the log" }, "type": "library", "extra": { "branch-alias": { - "dev-develop": "1.0-dev" + "dev-master": "1.0-dev" }, "laravel": { - "aliases": { - "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", - "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" - }, "providers": [ - "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" - ] + "Torann\\GeoIP\\GeoIPServiceProvider" + ], + "aliases": { + "GeoIP": "Torann\\GeoIP\\Facades\\GeoIP" + } } }, "autoload": { + "files": [ + "src/helpers.php" + ], "psr-4": { - "Tymon\\JWTAuth\\": "src/" + "Torann\\GeoIP\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "Sean Tymon", - "email": "tymon148@gmail.com", - "homepage": "https://tymon.xyz", - "role": "Developer" + "name": "Daniel Stainback", + "email": "torann@gmail.com" } ], - "description": "JSON Web Token Authentication for Laravel and Lumen", - "homepage": "https://github.com/tymondesigns/jwt-auth", + "description": "Support for multiple GeoIP services.", "keywords": [ - "Authentication", - "JSON Web Token", - "auth", - "jwt", - "laravel" + "IP API", + "geoip", + "geolocation", + "infoDB", + "laravel", + "location", + "maxmind" ], "support": { - "issues": "https://github.com/tymondesigns/jwt-auth/issues", - "source": "https://github.com/tymondesigns/jwt-auth" + "issues": "https://github.com/Torann/laravel-geoip/issues", + "source": "https://github.com/Torann/laravel-geoip/tree/3.0.2" }, - "funding": [ - { - "url": "https://www.patreon.com/seantymon", - "type": "patreon" - } - ], - "time": "2020-03-04T11:21:28+00:00" + "time": "2020-12-21T19:12:11+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v4.2.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "da64796370fc4eb03cc277088f6fede9fde88482" + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/da64796370fc4eb03cc277088f6fede9fde88482", - "reference": "da64796370fc4eb03cc277088f6fede9fde88482", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "phpoption/phpoption": "^1.7.3", - "symfony/polyfill-ctype": "^1.17" + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.1", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.7.4", + "symfony/polyfill-ctype": "^1.17", + "symfony/polyfill-mbstring": "^1.17", + "symfony/polyfill-php80": "^1.17" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "ext-pcre": "*", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20" + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" }, "suggest": { - "ext-filter": "Required to use the boolean validator.", - "ext-pcre": "Required to use most of the library." + "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "5.3-dev" } }, "autoload": { @@ -6086,7 +5807,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v4.2.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" }, "funding": [ { @@ -6098,7 +5819,7 @@ "type": "tidelift" } ], - "time": "2021-01-20T15:11:48+00:00" + "time": "2021-01-20T15:23:13+00:00" }, { "name": "voku/portable-ascii", @@ -6173,49 +5894,111 @@ } ], "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ { "name": "barryvdh/laravel-ide-helper", - "version": "v2.8.2", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "5515cabea39b9cf55f98980d0f269dc9d85cfcca" + "reference": "73b1012b927633a1b4cd623c2e6b1678e6faef08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/5515cabea39b9cf55f98980d0f269dc9d85cfcca", - "reference": "5515cabea39b9cf55f98980d0f269dc9d85cfcca", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/73b1012b927633a1b4cd623c2e6b1678e6faef08", + "reference": "73b1012b927633a1b4cd623c2e6b1678e6faef08", "shasum": "" }, "require": { "barryvdh/reflection-docblock": "^2.0.6", "composer/composer": "^1.6 || ^2", - "doctrine/dbal": "~2.3", + "doctrine/dbal": "^2.6 || ^3", "ext-json": "*", - "illuminate/console": "^6 || ^7 || ^8", - "illuminate/filesystem": "^6 || ^7 || ^8", - "illuminate/support": "^6 || ^7 || ^8", - "php": ">=7.2", + "illuminate/console": "^8", + "illuminate/filesystem": "^8", + "illuminate/support": "^8", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", "phpdocumentor/type-resolver": "^1.1.0" }, "require-dev": { "ext-pdo_sqlite": "*", "friendsofphp/php-cs-fixer": "^2", - "illuminate/config": "^6 || ^7 || ^8", - "illuminate/view": "^6 || ^7 || ^8", - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^4 || ^5 || ^6", + "illuminate/config": "^8", + "illuminate/view": "^8", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6", "phpunit/phpunit": "^8.5 || ^9", - "spatie/phpunit-snapshot-assertions": "^1.4 || ^2.2 || ^3 || ^4", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", "vimeo/psalm": "^3.12" }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8)." + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "2.9-dev" }, "laravel": { "providers": [ @@ -6252,7 +6035,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", - "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.8.2" + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.10.0" }, "funding": [ { @@ -6260,7 +6043,7 @@ "type": "github" } ], - "time": "2020-12-06T08:55:05+00:00" + "time": "2021-04-09T06:17:55+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -6392,39 +6175,37 @@ }, { "name": "composer/composer", - "version": "1.10.21", + "version": "2.0.12", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c" + "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/04021432f4a9cbd9351dd166b8c193f42c36a39c", - "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c", + "url": "https://api.github.com/repos/composer/composer/zipball/6c12ce263da71641903e399c3ce8ecb08fd375fb", + "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", + "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^5.2.10", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", + "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0" }, "require-dev": { "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2" + "symfony/phpunit-bridge": "^4.2 || ^5.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -6437,7 +6218,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -6453,12 +6234,12 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "homepage": "https://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", @@ -6471,7 +6252,80 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.21" + "source": "https://github.com/composer/composer/tree/2.0.12" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-01T08:14:59+00:00" + }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.1", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" }, "funding": [ { @@ -6487,32 +6341,33 @@ "type": "tidelift" } ], - "time": "2021-04-01T07:16:35+00:00" + "time": "2020-11-11T10:22:58+00:00" }, { "name": "composer/semver", - "version": "1.7.2", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -6551,7 +6406,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.7.2" + "source": "https://github.com/composer/semver/tree/3.2.4" }, "funding": [ { @@ -6567,7 +6422,7 @@ "type": "tidelift" } ], - "time": "2020-12-03T15:47:16+00:00" + "time": "2020-11-13T08:59:24+00:00" }, { "name": "composer/spdx-licenses", @@ -6954,32 +6809,33 @@ }, { "name": "doctrine/dbal", - "version": "2.13.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796" + "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/67d56d3203b33db29834e6b2fcdbfdc50535d796", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/ee6d1260d5cc20ec506455a585945d7bdb98662c", + "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c", "shasum": "" }, "require": { + "composer/package-versions-deprecated": "^1.11.99", "doctrine/cache": "^1.0", - "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "php": "^7.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "8.2.0", - "jetbrains/phpstorm-stubs": "2020.2", - "phpstan/phpstan": "0.12.81", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.0", + "doctrine/coding-standard": "^8.1", + "jetbrains/phpstorm-stubs": "^2019.1", + "phpstan/phpstan": "^0.12.40", + "phpstan/phpstan-strict-rules": "^0.12.2", + "phpunit/phpunit": "^9.4", + "psalm/plugin-phpunit": "^0.10.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.6.4" + "vimeo/psalm": "^3.17.2" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -6988,9 +6844,14 @@ "bin/doctrine-dbal" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -7033,14 +6894,13 @@ "queryobject", "sasql", "sql", - "sqlanywhere", "sqlite", "sqlserver", "sqlsrv" ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.0" + "source": "https://github.com/doctrine/dbal/tree/3.0.0" }, "funding": [ { @@ -7056,70 +6916,27 @@ "type": "tidelift" } ], - "time": "2021-03-28T18:10:53+00:00" + "time": "2020-11-15T18:20:41+00:00" }, { - "name": "doctrine/deprecations", - "version": "v0.5.3", + "name": "doctrine/event-manager", + "version": "1.1.1", "source": { "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" + "url": "https://github.com/doctrine/event-manager.git", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", + "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", + "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, - "require-dev": { - "doctrine/coding-standard": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v0.5.3" - }, - "time": "2021-03-21T12:59:47+00:00" - }, - { - "name": "doctrine/event-manager", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/doctrine/event-manager.git", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/event-manager/zipball/41370af6a30faa9dc0368c4a6814d596e81aba7f", - "reference": "41370af6a30faa9dc0368c4a6814d596e81aba7f", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/common": "<2.9@dev" + "conflict": { + "doctrine/common": "<2.9@dev" }, "require-dev": { "doctrine/coding-standard": "^6.0", @@ -7459,6 +7276,71 @@ }, "time": "2020-10-16T08:27:54+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.14.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.2" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-intl": "*", + "symfony/phpunit-bridge": "^4.4 || ^5.2" + }, + "suggest": { + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "v1.15-dev" + } + }, + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v.1.14.1" + }, + "time": "2021-03-30T06:27:33+00:00" + }, { "name": "filp/whoops", "version": "2.12.0", @@ -7634,61 +7516,6 @@ ], "time": "2021-04-06T18:37:33+00:00" }, - { - "name": "fzaninotto/faker", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" - }, - "abandoned": true, - "time": "2020-12-11T09:56:16+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -8106,35 +7933,35 @@ }, { "name": "nunomaduro/collision", - "version": "v4.3.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e" + "reference": "41b7e9999133d5082700d31a1d0977161df8322a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c125dc2463f3e144ddc7e05e63077109508c94e", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a", + "reference": "41b7e9999133d5082700d31a1d0977161df8322a", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.4", - "php": "^7.2.5 || ^8.0", + "filp/whoops": "^2.7.2", + "php": "^7.3 || ^8.0", "symfony/console": "^5.0" }, "require-dev": { - "facade/ignition": "^2.0", - "fideloper/proxy": "^4.2", - "friendsofphp/php-cs-fixer": "^2.16", - "fruitcake/laravel-cors": "^1.0", - "laravel/framework": "^7.0", - "laravel/tinker": "^2.0", - "nunomaduro/larastan": "^0.6", - "orchestra/testbench": "^5.0", - "phpstan/phpstan": "^0.12.3", - "phpunit/phpunit": "^8.5.1 || ^9.0" + "brianium/paratest": "^6.1", + "fideloper/proxy": "^4.4.1", + "friendsofphp/php-cs-fixer": "^2.17.3", + "fruitcake/laravel-cors": "^2.0.3", + "laravel/framework": "^9.0", + "nunomaduro/larastan": "^0.6.2", + "nunomaduro/mock-final-classes": "^1.0", + "orchestra/testbench": "^7.0", + "phpstan/phpstan": "^0.12.64", + "phpunit/phpunit": "^9.5.0" }, "type": "library", "extra": { @@ -8190,55 +8017,60 @@ "type": "patreon" } ], - "time": "2020-10-29T15:12:23+00:00" + "time": "2021-04-09T13:38:32+00:00" }, { "name": "nunomaduro/phpinsights", - "version": "v1.14.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/nunomaduro/phpinsights.git", - "reference": "d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf" + "reference": "4b630770b3ce6cacb62663ff0c8b8286b0b58056" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf", - "reference": "d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/4b630770b3ce6cacb62663ff0c8b8286b0b58056", + "reference": "4b630770b3ce6cacb62663ff0c8b8286b0b58056", "shasum": "" }, "require": { - "composer/composer": "^1.7", + "composer/composer": "^1.7 || ^2.0", "ext-iconv": "*", "ext-json": "*", "ext-mbstring": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^2.15", + "friendsofphp/php-cs-fixer": "^2.16.1", "justinrainbow/json-schema": "^5.1", "league/container": "^3.2", "object-calisthenics/phpcs-calisthenics-rules": "^3.7", - "php": "^7.2", - "phploc/phploc": "^5.0|^6.0", + "php": "^7.4 || ^8.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phploc/phploc": "^5.0|^6.0|^7.0", "psr/container": "^1.0", + "psr/simple-cache": "^1.0", "slevomat/coding-standard": "^6.0", - "squizlabs/php_codesniffer": "^3.4", + "squizlabs/php_codesniffer": "^3.5", + "symfony/cache": "^4.4|^5.0", "symfony/console": "^4.2|^5.0", "symfony/finder": "^4.2|^5.0", "symfony/http-client": "^4.3|^5.0" }, "require-dev": { "ergebnis/phpstan-rules": "^0.14.0", - "illuminate/console": "^5.8|^6.0|^7.0", - "illuminate/support": "^5.8|^6.0|^7.0", + "illuminate/console": "^5.8|^6.0|^7.0|^8.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0", "mockery/mockery": "^1.0", "phpstan/phpstan-strict-rules": "^0.12", "phpunit/phpunit": "^8.0|^9.0", + "rector/rector-prefixed": "^0.9.19", "symfony/var-dumper": "^4.2|^5.0", - "symplify/easy-coding-standard": "^7.1", + "symplify/easy-coding-standard": "^9.1", "thecodingmachine/phpstan-strict-rules": "^0.12.0" }, "suggest": { "ext-simplexml": "It is needed for the checkstyle formatter" }, + "default-branch": true, "bin": [ "bin/phpinsights" ], @@ -8276,7 +8108,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/phpinsights/issues", - "source": "https://github.com/nunomaduro/phpinsights/tree/v1.14.1" + "source": "https://github.com/nunomaduro/phpinsights/tree/master" }, "funding": [ { @@ -8296,7 +8128,7 @@ "type": "patreon" } ], - "time": "2021-01-27T19:08:59+00:00" + "time": "2021-03-21T11:04:47+00:00" }, { "name": "object-calisthenics/phpcs-calisthenics-rules", @@ -8514,6 +8346,63 @@ }, "time": "2020-10-14T08:39:05+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "772a954e5f119f6f5871d015b23eabed8cbdadfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/772a954e5f119f6f5871d015b23eabed8cbdadfb", + "reference": "772a954e5f119f6f5871d015b23eabed8cbdadfb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "~0.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.0" + }, + "time": "2021-04-07T14:42:48+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -8674,25 +8563,25 @@ }, { "name": "phploc/phploc", - "version": "6.0.2", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29" + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29", - "reference": "00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "php": "^7.3", - "sebastian/finder-facade": "^2.0", - "sebastian/version": "^3.0", - "symfony/console": "^4.0 || ^5.0" + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0", + "sebastian/cli-parser": "^1.0", + "sebastian/version": "^3.0" }, "bin": [ "phploc" @@ -8700,7 +8589,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -8723,9 +8612,15 @@ "homepage": "https://github.com/sebastianbergmann/phploc", "support": { "issues": "https://github.com/sebastianbergmann/phploc/issues", - "source": "https://github.com/sebastianbergmann/phploc/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/phploc/tree/7.0.2" }, - "time": "2020-02-28T05:42:22+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-12-07T05:51:20+00:00" }, { "name": "phpspec/prophecy", @@ -9268,6 +9163,105 @@ ], "time": "2021-03-23T07:16:29+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "react/promise", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.8.0" + }, + "time": "2020-05-12T15:16:56+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -9773,68 +9767,17 @@ "time": "2020-09-28T05:24:23+00:00" }, { - "name": "sebastian/finder-facade", - "version": "2.0.0", + "name": "sebastian/global-state", + "version": "5.0.2", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c" + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.3", - "symfony/finder": "^4.1|^5.0", - "theseer/fdomdocument": "^1.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", - "homepage": "https://github.com/sebastianbergmann/finder-facade", - "support": { - "issues": "https://github.com/sebastianbergmann/finder-facade/issues", - "source": "https://github.com/sebastianbergmann/finder-facade/tree/2.0.0" - }, - "abandoned": true, - "time": "2020-02-08T06:07:58+00:00" - }, - { - "name": "sebastian/global-state", - "version": "5.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", - "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { @@ -10511,6 +10454,180 @@ }, "time": "2021-04-09T00:54:41+00:00" }, + { + "name": "symfony/cache", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/093d69bb10c959553c8beb828b8d4ea250a247dd", + "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "conflict": { + "doctrine/dbal": "<2.10", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6", + "doctrine/dbal": "^2.10|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/filesystem": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an extended PSR-6, PSR-16 (and tags) implementation", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-16T09:10:13+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, { "name": "symfony/filesystem", "version": "v5.2.6", @@ -10859,48 +10976,77 @@ "time": "2021-01-27T10:15:41+00:00" }, { - "name": "theseer/fdomdocument", - "version": "1.6.6", + "name": "symfony/var-exporter", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca" + "url": "https://github.com/symfony/var-exporter.git", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/5aed4875ab514c8cb9b6ff4772baa25fa4c10307", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307", "shasum": "" }, "require": { - "ext-dom": "*", - "lib-libxml": "*", - "php": ">=5.3.3" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9" }, "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", - "homepage": "https://github.com/theseer/fDOMDocument", + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], "support": { - "issues": "https://github.com/theseer/fDOMDocument/issues", - "source": "https://github.com/theseer/fDOMDocument/tree/master" + "source": "https://github.com/symfony/var-exporter/tree/v5.2.4" }, - "time": "2017-06-30T11:53:12+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T10:01:46+00:00" }, { "name": "theseer/tokenizer", @@ -10951,73 +11097,17 @@ } ], "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], - "minimum-stability": "RC", - "stability-flags": [], + "minimum-stability": "stable", + "stability-flags": { + "nunomaduro/phpinsights": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4", + "php": "^8.0", "ext-bcmath": "*", "ext-json": "*", "ext-pcntl": "*", diff --git a/default-structure/config/app.php b/default-structure/config/app.php index 41b0e98..07128a6 100644 --- a/default-structure/config/app.php +++ b/default-structure/config/app.php @@ -39,7 +39,7 @@ | */ - 'debug' => env('APP_DEBUG', false), + 'debug' => (bool) env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- @@ -54,6 +54,8 @@ 'url' => env('APP_URL', 'http://localhost'), + 'asset_url' => env('ASSET_URL', null), + 'support_url' => env('SUPPORT_URL', 'http://localhost'), 'support_email' => env('SUPPORT_EMAIL', 'support@example.com'), 'will_check_device_is_authorized' => env('WILL_CHECK_DEVICE_IS_AUTHORIZED', false), @@ -178,11 +180,10 @@ */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, + App\Providers\FortifyServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, - App\Providers\HorizonServiceProvider::class, App\Providers\RouteServiceProvider::class, - App\Providers\RepositoryServiceProvider::class, ], @@ -199,39 +200,43 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'Date' => Illuminate\Support\Facades\Date::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + '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, 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + // 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, ], diff --git a/default-structure/config/auth.php b/default-structure/config/auth.php index 7cc99c5..ba1a4d8 100644 --- a/default-structure/config/auth.php +++ b/default-structure/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'api', + 'guard' => 'web', 'passwords' => 'users', ], @@ -36,9 +36,15 @@ */ 'guards' => [ + 'web' => [ + 'driver' => 'session', + 'provider' => 'users', + ], + 'api' => [ - 'driver' => 'jwt', + 'driver' => 'token', 'provider' => 'users', + 'hash' => false, ], ], @@ -62,7 +68,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => App\Models\User::class, ], // 'users' => [ @@ -89,8 +95,8 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, 'throttle' => 60, ], ], diff --git a/default-structure/config/broadcasting.php b/default-structure/config/broadcasting.php index 77e910d..2d52982 100644 --- a/default-structure/config/broadcasting.php +++ b/default-structure/config/broadcasting.php @@ -11,11 +11,11 @@ | framework when an event needs to be broadcast. You may set this to | any of the connections defined in the "connections" array below. | - | Supported: "pusher", "redis", "log", "null" + | Supported: "pusher", "ably", "redis", "log", "null" | */ - 'default' => env('BROADCAST_DRIVER', 'pusher'), + 'default' => env('BROADCAST_DRIVER', 'null'), /* |-------------------------------------------------------------------------- @@ -31,18 +31,34 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_APP_HOST', '127.0.0.1'), - 'port' => 6001, - 'scheme' => 'http', - 'encrypted' => false, + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'useTLS' => true, ], ], + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + ], ]; diff --git a/default-structure/config/cache.php b/default-structure/config/cache.php index d0e7248..e32a2fd 100644 --- a/default-structure/config/cache.php +++ b/default-structure/config/cache.php @@ -13,9 +13,6 @@ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | - | Supported: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb" - | */ 'default' => env('CACHE_DRIVER', 'file'), @@ -29,6 +26,9 @@ | well as their drivers. You may even define multiple stores for the | same cache driver to group types of items stored in your caches. | + | Supported drivers: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb", "null" + | */ 'stores' => [ @@ -39,49 +39,52 @@ 'array' => [ 'driver' => 'array', + 'serialize' => false, ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, + 'lock_connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], - 'options' => [ + 'options' => [ // Memcached::OPT_CONNECT_TIMEOUT => 2000, ], - 'servers' => [ + 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'cache', + 'lock_connection' => 'default', ], 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'endpoint' => env('DYNAMODB_ENDPOINT'), ], @@ -98,6 +101,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), ]; diff --git a/default-structure/config/cors.php b/default-structure/config/cors.php new file mode 100644 index 0000000..7dbe8bb --- /dev/null +++ b/default-structure/config/cors.php @@ -0,0 +1,45 @@ + [ + 'api/*', + 'login', + 'logout', + 'register', + 'user/password', + 'forgot-password', + 'reset-password', + 'sanctum/csrf-cookie', + 'user/profile-information', + 'email/verification-notification', + ], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => true, + +]; diff --git a/default-structure/config/database.php b/default-structure/config/database.php index a9ebf4d..e09f75e 100644 --- a/default-structure/config/database.php +++ b/default-structure/config/database.php @@ -36,58 +36,58 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], @@ -123,25 +123,25 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], ], -]; +]; \ No newline at end of file diff --git a/default-structure/config/filesystems.php b/default-structure/config/filesystems.php index 5a78c8a..10c9d9b 100644 --- a/default-structure/config/filesystems.php +++ b/default-structure/config/filesystems.php @@ -15,19 +15,6 @@ 'default' => env('FILESYSTEM_DRIVER', 'local'), - /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ - - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), - /* |-------------------------------------------------------------------------- | Filesystem Disks @@ -45,35 +32,41 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), ], - 'gcs' => [ - 'driver' => 's3', - 'key' => env('GCS_KEY'), - 'secret' => env('GCS_SECRET'), - 'region' => env('GCS_REGION'), - 'bucket' => env('GCS_BUCKET'), - 'endpoint' => 'https://storage.googleapis.com', - ], + ], + + /* + |-------------------------------------------------------------------------- + | 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/default-structure/config/fortify.php b/default-structure/config/fortify.php new file mode 100644 index 0000000..d3fd70a --- /dev/null +++ b/default-structure/config/fortify.php @@ -0,0 +1,145 @@ + 'web', + + /* + |-------------------------------------------------------------------------- + | Fortify Password Broker + |-------------------------------------------------------------------------- + | + | Here you may specify which password broker Fortify can use when a user + | is resetting their password. This configured value should match one + | of your password brokers setup in your "auth" configuration file. + | + */ + + 'passwords' => 'users', + + /* + |-------------------------------------------------------------------------- + | Username / Email + |-------------------------------------------------------------------------- + | + | This value defines which model attribute should be considered as your + | application's "username" field. Typically, this might be the email + | address of the users but you are free to change this value here. + | + | Out of the box, Fortify expects forgot password and reset password + | requests to have a field named 'email'. If the application uses + | another name for the field you may define it below as needed. + | + */ + + 'username' => 'email', + + 'email' => 'email', + + /* + |-------------------------------------------------------------------------- + | Home Path + |-------------------------------------------------------------------------- + | + | Here you may configure the path where users will get redirected during + | authentication or password reset when the operations are successful + | and the user is authenticated. You are free to change this value. + | + */ + + 'home' => env('SPA_URL') . '/dashboard', + + /* + |-------------------------------------------------------------------------- + | Fortify Routes Prefix / Subdomain + |-------------------------------------------------------------------------- + | + | Here you may specify which prefix Fortify will assign to all the routes + | that it registers with the application. If necessary, you may change + | subdomain under which all of the Fortify routes will be available. + | + */ + + 'prefix' => '', + + 'domain' => null, + + /* + |-------------------------------------------------------------------------- + | Fortify Routes Middleware + |-------------------------------------------------------------------------- + | + | Here you may specify which middleware Fortify will assign to the routes + | that it registers with the application. If necessary, you may change + | these middleware but typically this provided default is preferred. + | + */ + + 'middleware' => ['web'], + + /* + |-------------------------------------------------------------------------- + | Rate Limiting + |-------------------------------------------------------------------------- + | + | By default, Fortify will throttle logins to five requests per minute for + | every email and IP address combination. However, if you would like to + | specify a custom rate limiter to call then you may specify it here. + | + */ + + 'limiters' => [ + 'login' => 'login', + 'two-factor' => 'two-factor', + ], + + /* + |-------------------------------------------------------------------------- + | Register View Routes + |-------------------------------------------------------------------------- + | + | Here you may specify if the routes returning views should be disabled as + | you may not need them when building your own application. This may be + | especially true if you're writing a custom single-page application. + | + */ + + 'views' => false, + + /* + |-------------------------------------------------------------------------- + | Features + |-------------------------------------------------------------------------- + | + | Some of the Fortify features are optional. You may disable the features + | by removing them from this array. You're free to only remove some of + | these features or you can even remove all of these if you need to. + | + */ + + 'features' => [ + Features::registration(), + Features::resetPasswords(), + // Features::emailVerification(), + Features::updateProfileInformation(), + Features::updatePasswords(), + Features::twoFactorAuthentication([ + 'confirmPassword' => true, + ]), + ], + +]; diff --git a/default-structure/config/geoip.php b/default-structure/config/geoip.php new file mode 100644 index 0000000..695ec0b --- /dev/null +++ b/default-structure/config/geoip.php @@ -0,0 +1,173 @@ + true, + + /* + |-------------------------------------------------------------------------- + | Include Currency in Results + |-------------------------------------------------------------------------- + | + | When enabled the system will do it's best in deciding the user's currency + | by matching their ISO code to a preset list of currencies. + | + */ + + 'include_currency' => true, + + /* + |-------------------------------------------------------------------------- + | Default Service + |-------------------------------------------------------------------------- + | + | Here you may specify the default storage driver that should be used + | by the framework. + | + | Supported: "maxmind_database", "maxmind_api", "ipapi" + | + */ + + 'service' => 'ipapi', + + /* + |-------------------------------------------------------------------------- + | Storage Specific Configuration + |-------------------------------------------------------------------------- + | + | Here you may configure as many storage drivers as you wish. + | + */ + + 'services' => [ + + 'maxmind_database' => [ + 'class' => MaxMindDatabase::class, + 'database_path' => storage_path('app/geoip.mmdb'), + 'update_url' => sprintf('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gz', + env('MAXMIND_LICENSE_KEY')), + 'locales' => ['en'], + ], + + 'maxmind_api' => [ + 'class' => MaxMindWebService::class, + 'user_id' => env('MAXMIND_USER_ID'), + 'license_key' => env('MAXMIND_LICENSE_KEY'), + 'locales' => ['en'], + ], + + 'ipapi' => [ + 'class' => IPApi::class, + 'secure' => true, + 'key' => env('IPAPI_KEY'), + 'continent_path' => storage_path('app/continents.json'), + 'lang' => 'en', + ], + + 'ipgeolocation' => [ + 'class' => IPGeoLocation::class, + 'secure' => true, + 'key' => env('IPGEOLOCATION_KEY'), + 'continent_path' => storage_path('app/continents.json'), + 'lang' => 'en', + ], + + 'ipdata' => [ + 'class' => IPData::class, + 'key' => env('IPDATA_API_KEY'), + 'secure' => true, + ], + + 'ipfinder' => [ + 'class' => IPFinder::class, + 'key' => env('IPFINDER_API_KEY'), + 'secure' => true, + 'locales' => ['en'], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Default Cache Driver + |-------------------------------------------------------------------------- + | + | Here you may specify the type of caching that should be used + | by the package. + | + | Options: + | + | all - All location are cached + | some - Cache only the requesting user + | none - Disable cached + | + */ + + 'cache' => 'all', + + /* + |-------------------------------------------------------------------------- + | Cache Tags + |-------------------------------------------------------------------------- + | + | Cache tags are not supported when using the file or database cache + | drivers in Laravel. This is done so that only locations can be cleared. + | + */ + + 'cache_tags' => ['torann-geoip-location'], + + /* + |-------------------------------------------------------------------------- + | Cache Expiration + |-------------------------------------------------------------------------- + | + | Define how long cached location are valid. + | + */ + + 'cache_expires' => 30, + + /* + |-------------------------------------------------------------------------- + | Default Location + |-------------------------------------------------------------------------- + | + | Return when a location is not found. + | + */ + + 'default_location' => [ + 'ip' => '127.0.0.0', + 'iso_code' => 'US', + 'country' => 'United States', + 'city' => 'New Haven', + 'state' => 'CT', + 'state_name' => 'Connecticut', + 'postal_code' => '06510', + 'lat' => 41.31, + 'lon' => -72.92, + 'timezone' => 'America/New_York', + 'continent' => 'NA', + 'default' => true, + 'currency' => 'USD', + ], + +]; diff --git a/default-structure/config/horizon.php b/default-structure/config/horizon.php index e14e359..605882f 100644 --- a/default-structure/config/horizon.php +++ b/default-structure/config/horizon.php @@ -1,5 +1,7 @@ env('HORIZON_PREFIX', 'horizon:'), + 'prefix' => env( + 'HORIZON_PREFIX', + Str::slug(env('APP_NAME', 'laravel'), '_') . '_horizon:' + ), /* |-------------------------------------------------------------------------- @@ -65,7 +70,7 @@ | */ - 'middleware' => ['auth:api'], + 'middleware' => ['web'], /* |-------------------------------------------------------------------------- @@ -79,8 +84,7 @@ */ 'waits' => [ - 'redis:default' => 60, - 'redis:notifications' => 60, + 'redis:default' => 60, ], /* @@ -95,9 +99,30 @@ */ 'trim' => [ - 'recent' => 60, - 'failed' => 10080, - 'monitored' => 10080, + 'recent' => 60, + 'pending' => 60, + 'completed' => 60, + 'recent_failed' => 10080, + 'failed' => 10080, + 'monitored' => 10080, + ], + + /* + |-------------------------------------------------------------------------- + | Metrics + |-------------------------------------------------------------------------- + | + | Here you can configure how many snapshots should be kept to display in + | the metrics graph. This will get used in combination with Horizon's + | `horizon:snapshot` schedule to define how long to retain metrics. + | + */ + + 'metrics' => [ + 'trim_snapshots' => [ + 'job' => 24, + 'queue' => 24, + ], ], /* @@ -120,9 +145,9 @@ | Memory Limit (MB) |-------------------------------------------------------------------------- | - | This value describes the maximum amount of memory the Horizon worker - | may consume before it is terminated and restarted. You should set - | this value according to the resources available to your server. + | This value describes the maximum amount of memory the Horizon master + | supervisor may consume before it is terminated and restarted. For + | configuring these limits on your workers, see the next section. | */ @@ -139,30 +164,30 @@ | */ + 'defaults' => [ + 'supervisor-1' => [ + 'connection' => 'redis', + 'queue' => ['default', 'notifications'], + 'balance' => 'auto', + 'maxProcesses' => 1, + 'memory' => 128, + 'tries' => 1, + 'nice' => 0, + ], + ], + 'environments' => [ 'production' => [ - 'default' => [ - 'connection' => 'redis', - 'queue' => [ - 'default', - 'notifications', - ], - 'processes' => 10, - 'balance' => 'auto', - 'tries' => 3, + 'supervisor-1' => [ + 'maxProcesses' => 10, + 'balanceMaxShift' => 1, + 'balanceCooldown' => 3, ], ], 'local' => [ - 'default' => [ - 'connection' => 'redis', - 'queue' => [ - 'default', - 'notifications', - ], - 'processes' => 10, - 'balance' => 'auto', - 'tries' => 3, + 'supervisor-1' => [ + 'maxProcesses' => 3, ], ], ], diff --git a/default-structure/config/jwt.php b/default-structure/config/jwt.php deleted file mode 100644 index 19703da..0000000 --- a/default-structure/config/jwt.php +++ /dev/null @@ -1,303 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -return [ - - /* - |-------------------------------------------------------------------------- - | JWT Authentication Secret - |-------------------------------------------------------------------------- - | - | Don't forget to set this in your .env file, as it will be used to sign - | your tokens. A helper command is provided for this: - | `php artisan jwt:secret` - | - | Note: This will be used for Symmetric algorithms only (HMAC), - | since RSA and ECDSA use a private/public key combo (See below). - | - */ - - 'secret' => env('JWT_SECRET'), - - /* - |-------------------------------------------------------------------------- - | JWT Authentication Keys - |-------------------------------------------------------------------------- - | - | The algorithm you are using, will determine whether your tokens are - | signed with a random string (defined in `JWT_SECRET`) or using the - | following public & private keys. - | - | Symmetric Algorithms: - | HS256, HS384 & HS512 will use `JWT_SECRET`. - | - | Asymmetric Algorithms: - | RS256, RS384 & RS512 / ES256, ES384 & ES512 will use the keys below. - | - */ - - 'keys' => [ - - /* - |-------------------------------------------------------------------------- - | Public Key - |-------------------------------------------------------------------------- - | - | A path or resource to your public key. - | - | E.g. 'file://path/to/public/key' - | - */ - - 'public' => env('JWT_PUBLIC_KEY'), - - /* - |-------------------------------------------------------------------------- - | Private Key - |-------------------------------------------------------------------------- - | - | A path or resource to your private key. - | - | E.g. 'file://path/to/private/key' - | - */ - - 'private' => env('JWT_PRIVATE_KEY'), - - /* - |-------------------------------------------------------------------------- - | Passphrase - |-------------------------------------------------------------------------- - | - | The passphrase for your private key. Can be null if none set. - | - */ - - 'passphrase' => env('JWT_PASSPHRASE'), - - ], - - /* - |-------------------------------------------------------------------------- - | JWT time to live - |-------------------------------------------------------------------------- - | - | Specify the length of time (in minutes) that the token will be valid for. - | Defaults to 1 hour. - | - | You can also set this to null, to yield a never expiring token. - | Some people may want this behaviour for e.g. a mobile app. - | This is not particularly recommended, so make sure you have appropriate - | systems in place to revoke the token if necessary. - | - */ - - 'ttl' => env('JWT_TTL', 60), - - /* - |-------------------------------------------------------------------------- - | Refresh time to live - |-------------------------------------------------------------------------- - | - | Specify the length of time (in minutes) that the token can be refreshed - | within. I.E. The user can refresh their token within a 2 week window of - | the original token being created until they must re-authenticate. - | Defaults to 2 weeks. - | - | You can also set this to null, to yield an infinite refresh time. - | Some may want this instead of never expiring tokens for e.g. a mobile app. - | This is not particularly recommended, so make sure you have appropriate - | systems in place to revoke the token if necessary. - | - */ - - 'refresh_ttl' => env('JWT_REFRESH_TTL', 20160), - - /* - |-------------------------------------------------------------------------- - | JWT hashing algorithm - |-------------------------------------------------------------------------- - | - | Specify the hashing algorithm that will be used to sign the token. - | - | See here: https://github.com/namshi/jose/tree/master/src/Namshi/JOSE/Signer/OpenSSL - | for possible values. - | - */ - - 'algo' => env('JWT_ALGO', 'HS256'), - - /* - |-------------------------------------------------------------------------- - | Required Claims - |-------------------------------------------------------------------------- - | - | Specify the required claims that must exist in any token. - | A TokenInvalidException will be thrown if any of these claims are not - | present in the payload. - | - */ - - 'required_claims' => [ - 'iss', - 'iat', - 'exp', - 'nbf', - 'sub', - 'jti', - ], - - /* - |-------------------------------------------------------------------------- - | Persistent Claims - |-------------------------------------------------------------------------- - | - | Specify the claim keys to be persisted when refreshing a token. - | `sub` and `iat` will automatically be persisted, in - | addition to the these claims. - | - | Note: If a claim does not exist then it will be ignored. - | - */ - - 'persistent_claims' => [ - // 'foo', - // 'bar', - ], - - /* - |-------------------------------------------------------------------------- - | Lock Subject - |-------------------------------------------------------------------------- - | - | This will determine whether a `prv` claim is automatically added to - | the token. The purpose of this is to ensure that if you have multiple - | authentication models e.g. `Preferred\User` & `Preferred\OtherPerson`, then we - | should prevent one authentication request from impersonating another, - | if 2 tokens happen to have the same id across the 2 different models. - | - | Under specific circumstances, you may want to disable this behaviour - | e.g. if you only have one authentication model, then you would save - | a little on token size. - | - */ - - 'lock_subject' => true, - - /* - |-------------------------------------------------------------------------- - | Leeway - |-------------------------------------------------------------------------- - | - | This property gives the jwt timestamp claims some "leeway". - | Meaning that if you have any unavoidable slight clock skew on - | any of your servers then this will afford you some level of cushioning. - | - | This applies to the claims `iat`, `nbf` and `exp`. - | - | Specify in seconds - only if you know you need it. - | - */ - - 'leeway' => env('JWT_LEEWAY', 0), - - /* - |-------------------------------------------------------------------------- - | Blacklist Enabled - |-------------------------------------------------------------------------- - | - | In order to invalidate tokens, you must have the blacklist enabled. - | If you do not want or need this functionality, then set this to false. - | - */ - - 'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true), - - /* - | ------------------------------------------------------------------------- - | Blacklist Grace Period - | ------------------------------------------------------------------------- - | - | When multiple concurrent requests are made with the same JWT, - | it is possible that some of them fail, due to token regeneration - | on every request. - | - | Set grace period in seconds to prevent parallel request failure. - | - */ - - 'blacklist_grace_period' => env('JWT_BLACKLIST_GRACE_PERIOD', 0), - - /* - |-------------------------------------------------------------------------- - | Cookies encryption - |-------------------------------------------------------------------------- - | - | By default Laravel encrypt cookies for security reason. - | If you decide to not decrypt cookies, you will have to configure Laravel - | to not encrypt your cookie token by adding its name into the $except - | array available in the middleware "EncryptCookies" provided by Laravel. - | see https://laravel.com/docs/master/responses#cookies-and-encryption - | for details. - | - | Set it to true if you want to decrypt cookies. - | - */ - - 'decrypt_cookies' => false, - - /* - |-------------------------------------------------------------------------- - | Providers - |-------------------------------------------------------------------------- - | - | Specify the various providers used throughout the package. - | - */ - - 'providers' => [ - - /* - |-------------------------------------------------------------------------- - | JWT Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to create and decode the tokens. - | - */ - - 'jwt' => Tymon\JWTAuth\Providers\JWT\Lcobucci::class, - - /* - |-------------------------------------------------------------------------- - | Authentication Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to authenticate users. - | - */ - - 'auth' => Tymon\JWTAuth\Providers\Auth\Illuminate::class, - - /* - |-------------------------------------------------------------------------- - | Storage Provider - |-------------------------------------------------------------------------- - | - | Specify the provider that is used to store tokens in the blacklist. - | - */ - - 'storage' => Tymon\JWTAuth\Providers\Storage\Illuminate::class, - - ], - -]; diff --git a/default-structure/config/logging.php b/default-structure/config/logging.php index 088c204..1aa06aa 100644 --- a/default-structure/config/logging.php +++ b/default-structure/config/logging.php @@ -44,13 +44,13 @@ 'single' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, ], @@ -59,12 +59,12 @@ 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', 'emoji' => ':boom:', - 'level' => 'critical', + 'level' => env('LOG_LEVEL', 'critical'), ], 'papertrail' => [ 'driver' => 'monolog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), @@ -74,6 +74,7 @@ 'stderr' => [ 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ @@ -83,12 +84,12 @@ 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'null' => [ diff --git a/default-structure/config/queue.php b/default-structure/config/queue.php index 3a30d6c..63b57c2 100644 --- a/default-structure/config/queue.php +++ b/default-structure/config/queue.php @@ -39,6 +39,7 @@ 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, + 'after_commit' => false, ], 'beanstalkd' => [ @@ -47,6 +48,7 @@ 'queue' => 'default', 'retry_after' => 90, 'block_for' => 0, + 'after_commit' => false, ], 'sqs' => [ @@ -54,8 +56,10 @@ 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, ], 'redis' => [ @@ -64,6 +68,7 @@ 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, 'block_for' => null, + 'after_commit' => false, ], ], @@ -80,9 +85,9 @@ */ 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], -]; +]; \ No newline at end of file diff --git a/default-structure/config/register.php b/default-structure/config/register.php deleted file mode 100644 index aea6509..0000000 --- a/default-structure/config/register.php +++ /dev/null @@ -1,12 +0,0 @@ - env('REGISTER_COMMANDS', true), - 'factories' => env('REGISTER_FACTORIES', true), - 'migrations' => env('REGISTER_MIGRATIONS', true), - 'translations' => env('REGISTER_TRANSLATIONS', true), - 'views' => env('REGISTER_VIEWS', true), - 'policies' => env('REGISTER_POLICIES', true), - 'api_routes' => env('REGISTER_API_ROUTES', true), - 'will_check_device_is_authorized' => env('WILL_CHECK_DEVICE_IS_AUTHORIZED', false), -]; diff --git a/default-structure/config/sanctum.php b/default-structure/config/sanctum.php new file mode 100644 index 0000000..3ccc3ca --- /dev/null +++ b/default-structure/config/sanctum.php @@ -0,0 +1,50 @@ + explode(',', env( + 'SANCTUM_STATEFUL_DOMAINS', + 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1,'.parse_url(env('APP_URL'), PHP_URL_HOST) + )), + + /* + |-------------------------------------------------------------------------- + | Expiration Minutes + |-------------------------------------------------------------------------- + | + | This value controls the number of minutes until an issued token will be + | considered expired. If this value is null, personal access tokens do + | not expire. This won't tweak the lifetime of first-party sessions. + | + */ + + 'expiration' => null, + + /* + |-------------------------------------------------------------------------- + | Sanctum Middleware + |-------------------------------------------------------------------------- + | + | When authenticating your first-party SPA with Sanctum you may need to + | customize some of the middleware Sanctum uses while processing the + | request. You may change the middleware listed below as required. + | + */ + + 'middleware' => [ + 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, + 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, + ], + +]; diff --git a/default-structure/config/session.php b/default-structure/config/session.php index 3e9082d..4e0f66c 100644 --- a/default-structure/config/session.php +++ b/default-structure/config/session.php @@ -92,10 +92,12 @@ | Session Cache Store |-------------------------------------------------------------------------- | - | When using the "apc", "memcached", or "dynamodb" session drivers you may + | While using one of the framework's cache driven session backends you may | list a cache store that should be used for these sessions. This value | must match with one of the application's configured cache "stores". | + | Affects: "apc", "dynamodb", "memcached", "redis" + | */ 'store' => env('SESSION_STORE', null), @@ -166,7 +168,7 @@ | */ - 'secure' => env('SESSION_SECURE_COOKIE', null), + 'secure' => env('SESSION_SECURE_COOKIE'), /* |-------------------------------------------------------------------------- @@ -188,12 +190,12 @@ | | This option determines how your cookies behave when cross-site requests | 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. + | will set this value to "lax" since this is a secure default value. | - | Supported: "lax", "strict", "none" + | Supported: "lax", "strict", "none", null | */ - 'same_site' => null, + 'same_site' => 'lax', ]; diff --git a/default-structure/database/factories/AuthorizedDeviceFactory.php b/default-structure/database/factories/AuthorizedDeviceFactory.php index 2f02528..8816d32 100644 --- a/default-structure/database/factories/AuthorizedDeviceFactory.php +++ b/default-structure/database/factories/AuthorizedDeviceFactory.php @@ -1,19 +1,29 @@ define(App\Models\AuthorizedDevice::class, function (Faker $faker) { - return [ - 'id' => Uuid::uuid4(), - 'authorization_token' => Uuid::uuid4(), - 'device' => $this->faker->phoneNumber, - 'platform' => $this->faker->phoneNumber, - 'browser' => $this->faker->randomElement([ - 'safari', - 'chrome', - 'firefox', - 'brave' - ]), - ]; -}); +class AuthorizedDeviceFactory extends Factory +{ + protected $model = AuthorizedDevice::class; + + public function definition(): array + { + return [ + 'id' => Uuid::uuid4()->toString(), + 'authorization_token' => Uuid::uuid4()->toString(), + 'device' => $this->faker->phoneNumber, + 'platform' => $this->faker->phoneNumber, + 'browser' => $this->faker->randomElement([ + 'safari', + 'chrome', + 'firefox', + 'brave', + ]), + ]; + } +} + diff --git a/default-structure/database/factories/LoginHistoryFactory.php b/default-structure/database/factories/LoginHistoryFactory.php index aba72be..b546e04 100644 --- a/default-structure/database/factories/LoginHistoryFactory.php +++ b/default-structure/database/factories/LoginHistoryFactory.php @@ -1,10 +1,19 @@ define(App\Models\LoginHistory::class, function (Faker $faker) { - return [ - 'id' => Uuid::uuid4(), - ]; -}); +class LoginHistoryFactory extends Factory +{ + protected $model = LoginHistory::class; + + public function definition(): array + { + return [ + 'id' => Uuid::uuid4()->toString(), + ]; + } +} diff --git a/default-structure/database/factories/UserFactory.php b/default-structure/database/factories/UserFactory.php index 1bf522c..b10447d 100644 --- a/default-structure/database/factories/UserFactory.php +++ b/default-structure/database/factories/UserFactory.php @@ -1,43 +1,48 @@ define(App\Models\User::class, function (Faker $faker) { - return [ - 'id' => Uuid::uuid4(), - 'name' => $faker->name, - 'anti_phishing_code' => $faker->word, - 'email_token_confirmation' => Uuid::uuid4(), - 'email_token_disable_account' => Uuid::uuid4(), - 'email' => strtolower(str_replace('-', '', Uuid::uuid4())) . '@gmail.com', - 'password' => bcrypt('secretxxx'), - 'is_active' => 1, - 'email_verified_at' => now(), - 'locale' => 'en_US', - ]; -}); - -$factory->state(App\Models\User::class, 'active', function () { - return [ - 'is_active' => true, - ]; -}); - -$factory->state(App\Models\User::class, 'inactive', function () { - return [ - 'is_active' => false, - ]; -}); - -$factory->state(App\Models\User::class, 'email_verified', function () { - return [ - 'email_verified_at' => now()->format('Y-m-d H:i:s'), - ]; -}); - -$factory->state(App\Models\User::class, 'email_unverified', function () { - return [ - 'email_verified_at' => null, - ]; -}); +class UserFactory extends Factory +{ + protected $model = User::class; + + public function definition(): array + { + return [ + 'id' => Uuid::uuid4(), + 'name' => $this->faker->name, + 'anti_phishing_code' => $this->faker->word, + 'email_token_confirmation' => Uuid::uuid4(), + 'email_token_disable_account' => Uuid::uuid4(), + 'email' => $this->faker->unique()->email, + 'password' => bcrypt('secretxxx'), + 'is_active' => 1, + 'email_verified_at' => now(), + 'locale' => 'en_US', + ]; + } + + public function active(): UserFactory + { + return $this->state(fn() => ['is_active' => true]); + } + + public function inactive(): UserFactory + { + return $this->state(fn() => ['is_active' => false]); + } + + public function emailVerified(): UserFactory + { + return $this->state(fn() => ['email_verified_at' => now()->format('Y-m-d H:i:s')]); + } + + public function emailUnverified(): UserFactory + { + return $this->state(fn() => ['email_verified_at' => null]); + } +} diff --git a/default-structure/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php b/default-structure/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php new file mode 100644 index 0000000..f4500c9 --- /dev/null +++ b/default-structure/database/migrations/2014_10_12_200000_add_two_factor_columns_to_users_table.php @@ -0,0 +1,38 @@ +text('two_factor_secret') + ->after('password') + ->nullable(); + + $table->text('two_factor_recovery_codes') + ->after('two_factor_secret') + ->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('two_factor_secret', 'two_factor_recovery_codes'); + }); + } +} diff --git a/default-structure/database/migrations/2021_04_11_221810_add_uuid_to_failed_jobs_table.php b/default-structure/database/migrations/2021_04_11_221810_add_uuid_to_failed_jobs_table.php new file mode 100644 index 0000000..7975ad4 --- /dev/null +++ b/default-structure/database/migrations/2021_04_11_221810_add_uuid_to_failed_jobs_table.php @@ -0,0 +1,32 @@ +string('uuid')->after('id')->nullable()->unique(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('failed_jobs', function (Blueprint $table) { + $table->dropColumn('uuid'); + }); + } +} diff --git a/default-structure/docker-compose.develop.yml b/default-structure/docker-compose.develop.yml index 747c94f..8b8e53f 100644 --- a/default-structure/docker-compose.develop.yml +++ b/default-structure/docker-compose.develop.yml @@ -1,7 +1,7 @@ version: '3.6' services: nginx: - image: nginx:1.17-alpine + image: nginx:1.19-alpine container_name: default-structure-nginx restart: always volumes: @@ -36,7 +36,7 @@ services: - redis schedule: - image: ibrunotome/php:7.4 + image: ibrunotome/php:8.0 container_name: default-structure-schedule restart: always command: @@ -57,7 +57,7 @@ services: - redis queue: - image: ibrunotome/php:7.4 + image: ibrunotome/php:8.0 container_name: default-structure-queue restart: always command: php artisan horizon @@ -73,7 +73,7 @@ services: - redis pgsql: - image: launcher.gcr.io/google/postgresql11 + image: launcher.gcr.io/google/postgresql13 container_name: default-structure-pgsql ports: - 5432:5432 @@ -85,7 +85,7 @@ services: - pg-data:/var/lib/postgresql/data redis: - image: redis:5.0.5-alpine + image: library/redis:6.0.10-alpine container_name: default-structure-redis restart: always ports: diff --git a/default-structure/docker-compose.testing.yml b/default-structure/docker-compose.testing.yml index 6a97f86..8c7b7db 100644 --- a/default-structure/docker-compose.testing.yml +++ b/default-structure/docker-compose.testing.yml @@ -23,7 +23,7 @@ services: - redis pgsql: - image: launcher.gcr.io/google/postgresql11 + image: launcher.gcr.io/google/postgresql13 container_name: default-structure-pgsql-testing ports: - 5432:5432 @@ -35,7 +35,7 @@ services: - pg-testing-data:/var/lib/postgresql/data redis: - image: redis:5.0.5-alpine + image: library/redis:6.0.10-alpine container_name: default-structure-redis-testing restart: always ports: diff --git a/default-structure/php.ini b/default-structure/php.ini index 5b3f117..b389677 100644 --- a/default-structure/php.ini +++ b/default-structure/php.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,6 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so \ No newline at end of file diff --git a/default-structure/php.testing.ini b/default-structure/php.testing.ini index 748c074..71eaadb 100644 --- a/default-structure/php.testing.ini +++ b/default-structure/php.testing.ini @@ -2016,7 +2016,4 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so -zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so" \ No newline at end of file +zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so \ No newline at end of file diff --git a/modular-structure/Dockerfile b/modular-structure/Dockerfile index 295f5fc..05450c1 100644 --- a/modular-structure/Dockerfile +++ b/modular-structure/Dockerfile @@ -1,4 +1,4 @@ -FROM ibrunotome/php:7.4-fpm +FROM ibrunotome/php:8.0-fpm ARG COMPOSER_FLAGS @@ -12,8 +12,8 @@ RUN composer install $COMPOSER_FLAGS \ && chown -R 0:www-data /var/www \ && find /var/www -type f -exec chmod 664 {} \; \ && find /var/www -type d -exec chmod 775 {} \; \ - && chgrp -R www-data storage bootstrap/cache \ - && chmod -R ug+rwx storage bootstrap/cache + && chgrp -R www-data public/cache-html storage bootstrap/cache \ + && chmod -R ug+rwx public/cache-html storage bootstrap/cache CMD ["/usr/local/sbin/php-fpm"] From bfc808129e97280bd15e261e3df2dc40a2317cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sat, 17 Apr 2021 20:02:31 -0300 Subject: [PATCH 2/8] fix: tests in default-structure after laravel 8 --- .../app/Actions/Fortify/CreateNewUser.php | 41 - .../Fortify/PasswordValidationRules.php | 18 - .../app/Actions/Fortify/ResetUserPassword.php | 30 - .../Actions/Fortify/UpdateUserPassword.php | 35 - .../Fortify/UpdateUserProfileInformation.php | 61 -- default-structure/app/Http/Kernel.php | 2 - .../app/Models/AuthorizedDevice.php | 2 + default-structure/app/Models/LoginHistory.php | 3 + default-structure/app/Models/User.php | 24 +- .../app/Providers/FortifyServiceProvider.php | 47 -- .../app/Providers/RouteServiceProvider.php | 4 + default-structure/composer.json | 16 +- default-structure/composer.lock | 699 ++++++++++++------ default-structure/config/app.php | 2 +- default-structure/config/auth.php | 16 +- default-structure/config/fortify.php | 145 ---- default-structure/config/sanctum.php | 50 -- .../{seeds => seeders}/DatabaseSeeder.php | 0 .../PermissionsTableSeeder.php | 0 .../{seeds => seeders}/RolesTableSeeder.php | 0 .../{seeds => seeders}/UsersTableSeed.php | 0 default-structure/php.testing.ini | 2 +- default-structure/routes/api.php | 12 +- .../Feature/AuthorizeDeviceControllerTest.php | 32 +- .../Feature/DisableAccountControllerTest.php | 6 +- .../tests/Feature/LoginControllerTest.php | 6 +- .../Feature/NotificationControllerTest.php | 2 +- .../Feature/PasswordResetListenerTest.php | 2 +- .../tests/Feature/RegisterControllerTest.php | 9 +- .../Feature/ResetPasswordControllerTest.php | 4 +- .../TwoFactorAuthenticationControllerTest.php | 2 +- ...rAuthenticationWasDisabledListenerTest.php | 2 +- .../tests/Feature/UserControllerTest.php | 16 +- .../Feature/UserRegisteredListenerTest.php | 2 +- .../tests/Unit/AuthorizedDeviceTest.php | 4 +- .../tests/Unit/CurrentPasswordRuleTest.php | 2 +- .../tests/Unit/LoginHistoryTest.php | 4 +- .../tests/Unit/NotificationsTest.php | 2 +- .../tests/Unit/UserRepositoryTest.php | 2 +- default-structure/tests/Unit/UserTest.php | 6 +- 40 files changed, 563 insertions(+), 749 deletions(-) delete mode 100644 default-structure/app/Actions/Fortify/CreateNewUser.php delete mode 100644 default-structure/app/Actions/Fortify/PasswordValidationRules.php delete mode 100644 default-structure/app/Actions/Fortify/ResetUserPassword.php delete mode 100644 default-structure/app/Actions/Fortify/UpdateUserPassword.php delete mode 100644 default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php delete mode 100644 default-structure/app/Providers/FortifyServiceProvider.php delete mode 100644 default-structure/config/fortify.php delete mode 100644 default-structure/config/sanctum.php rename default-structure/database/{seeds => seeders}/DatabaseSeeder.php (100%) rename default-structure/database/{seeds => seeders}/PermissionsTableSeeder.php (100%) rename default-structure/database/{seeds => seeders}/RolesTableSeeder.php (100%) rename default-structure/database/{seeds => seeders}/UsersTableSeed.php (100%) diff --git a/default-structure/app/Actions/Fortify/CreateNewUser.php b/default-structure/app/Actions/Fortify/CreateNewUser.php deleted file mode 100644 index cc593f3..0000000 --- a/default-structure/app/Actions/Fortify/CreateNewUser.php +++ /dev/null @@ -1,41 +0,0 @@ - ['required', 'string', 'max:255'], - 'email' => [ - 'required', - 'string', - 'email', - 'max:255', - Rule::unique(User::class), - ], - 'password' => $this->passwordRules(), - ])->validate(); - - return User::create([ - 'name' => $input['name'], - 'email' => $input['email'], - 'password' => Hash::make($input['password']), - ]); - } -} diff --git a/default-structure/app/Actions/Fortify/PasswordValidationRules.php b/default-structure/app/Actions/Fortify/PasswordValidationRules.php deleted file mode 100644 index 78ed8cf..0000000 --- a/default-structure/app/Actions/Fortify/PasswordValidationRules.php +++ /dev/null @@ -1,18 +0,0 @@ - $this->passwordRules(), - ])->validate(); - - $user->forceFill([ - 'password' => Hash::make($input['password']), - ])->save(); - } -} diff --git a/default-structure/app/Actions/Fortify/UpdateUserPassword.php b/default-structure/app/Actions/Fortify/UpdateUserPassword.php deleted file mode 100644 index 690f324..0000000 --- a/default-structure/app/Actions/Fortify/UpdateUserPassword.php +++ /dev/null @@ -1,35 +0,0 @@ - ['required', 'string'], - 'password' => $this->passwordRules(), - ])->after(function ($validator) use ($user, $input) { - if (! isset($input['current_password']) || ! Hash::check($input['current_password'], $user->password)) { - $validator->errors()->add('current_password', __('The provided password does not match your current password.')); - } - })->validateWithBag('updatePassword'); - - $user->forceFill([ - 'password' => Hash::make($input['password']), - ])->save(); - } -} diff --git a/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php b/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php deleted file mode 100644 index 95e84ab..0000000 --- a/default-structure/app/Actions/Fortify/UpdateUserProfileInformation.php +++ /dev/null @@ -1,61 +0,0 @@ - ['required', 'string', 'max:255'], - - 'email' => [ - 'required', - 'string', - 'email', - 'max:255', - Rule::unique('users')->ignore($user->id), - ], - ])->validateWithBag('updateProfileInformation'); - - if ($input['email'] !== $user->email && - $user instanceof MustVerifyEmail) { - $this->updateVerifiedUser($user, $input); - } else { - $user->forceFill([ - 'name' => $input['name'], - 'email' => $input['email'], - ])->save(); - } - } - - /** - * Update the given verified user's profile information. - * - * @param mixed $user - * @param array $input - * @return void - */ - protected function updateVerifiedUser($user, array $input) - { - $user->forceFill([ - 'name' => $input['name'], - 'email' => $input['email'], - 'email_verified_at' => null, - ])->save(); - - $user->sendEmailVerificationNotification(); - } -} diff --git a/default-structure/app/Http/Kernel.php b/default-structure/app/Http/Kernel.php index 4207bac..8b831c0 100644 --- a/default-structure/app/Http/Kernel.php +++ b/default-structure/app/Http/Kernel.php @@ -21,7 +21,6 @@ use Illuminate\Routing\Middleware\SubstituteBindings; use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Routing\Middleware\ValidateSignature; -use Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful; class Kernel extends HttpKernel { @@ -49,7 +48,6 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'api' => [ - EnsureFrontendRequestsAreStateful::class, 'throttle:api', SubstituteBindings::class, ], diff --git a/default-structure/app/Models/AuthorizedDevice.php b/default-structure/app/Models/AuthorizedDevice.php index fcb0ab9..638003c 100644 --- a/default-structure/app/Models/AuthorizedDevice.php +++ b/default-structure/app/Models/AuthorizedDevice.php @@ -3,6 +3,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; @@ -54,6 +55,7 @@ class AuthorizedDevice extends Model implements AuditableContract { use Auditable; + use HasFactory; use SoftDeletes; protected static $unguarded = true; diff --git a/default-structure/app/Models/LoginHistory.php b/default-structure/app/Models/LoginHistory.php index 016cd0a..1d10d8f 100644 --- a/default-structure/app/Models/LoginHistory.php +++ b/default-structure/app/Models/LoginHistory.php @@ -3,6 +3,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; @@ -55,6 +56,8 @@ */ class LoginHistory extends Model { + use HasFactory; + public const UPDATED_AT = null; protected static $unguarded = true; diff --git a/default-structure/app/Models/User.php b/default-structure/app/Models/User.php index b078bd0..b7c4757 100644 --- a/default-structure/app/Models/User.php +++ b/default-structure/app/Models/User.php @@ -6,14 +6,15 @@ use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Contracts\Translation\HasLocalePreference; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Notifications\Notifiable; -use Laravel\Sanctum\HasApiTokens; use OwenIt\Auditing\Auditable; use OwenIt\Auditing\Contracts\Auditable as AuditableContract; use Spatie\Permission\Traits\HasRoles; +use Tymon\JWTAuth\Contracts\JWTSubject; /** * App\Models\User @@ -69,11 +70,11 @@ * @method static Builder|User whereUpdatedAt($value) * @mixin \Eloquent */ -class User extends Authenticatable implements AuditableContract, HasLocalePreference, MustVerifyEmail +class User extends Authenticatable implements JWTSubject, AuditableContract, HasLocalePreference, MustVerifyEmail { use Auditable; - use HasApiTokens; use HasRoles; + use HasFactory; use Notifiable; public $incrementing = false; @@ -101,6 +102,23 @@ class User extends Authenticatable implements AuditableContract, HasLocalePrefer 'remember_token', ]; + /** + * {@inheritdoc} + */ + public function getJWTIdentifier() + { + return $this->getKey(); + } + + /** + * {@inheritdoc} + */ + public function getJWTCustomClaims() + { + return []; + } + + public function receivesBroadcastNotificationsOn() { return 'users.' . $this->id; diff --git a/default-structure/app/Providers/FortifyServiceProvider.php b/default-structure/app/Providers/FortifyServiceProvider.php deleted file mode 100644 index dd29214..0000000 --- a/default-structure/app/Providers/FortifyServiceProvider.php +++ /dev/null @@ -1,47 +0,0 @@ -by($request->email.$request->ip()); - }); - - RateLimiter::for('two-factor', function (Request $request) { - return Limit::perMinute(5)->by($request->session()->get('login.id')); - }); - } -} diff --git a/default-structure/app/Providers/RouteServiceProvider.php b/default-structure/app/Providers/RouteServiceProvider.php index 6b6ce97..b4edf1e 100644 --- a/default-structure/app/Providers/RouteServiceProvider.php +++ b/default-structure/app/Providers/RouteServiceProvider.php @@ -45,5 +45,9 @@ protected function configureRateLimiting() RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); }); + + RateLimiter::for('hard', function (Request $request) { + return Limit::perMinute(2)->by(optional($request->user())->id ?: $request->ip()); + }); } } diff --git a/default-structure/composer.json b/default-structure/composer.json index d5c404c..5186a7d 100644 --- a/default-structure/composer.json +++ b/default-structure/composer.json @@ -20,17 +20,18 @@ "ext-pdo": "*", "fideloper/proxy": "^4.1", "fntneves/laravel-transactional-events": "^2.0", + "ibrunotome/google2fa-laravel": "^1.0", "jenssegers/agent": "^2.6", - "laravel/fortify": "^1.7", "laravel/framework": "^8.0", "laravel/horizon": "^5.0", - "laravel/sanctum": "^2.9", "laravel/tinker": "^2.0", + "laravel/ui": "^3.2", "league/flysystem-aws-s3-v3": "^1.0", "owen-it/laravel-auditing": "^12.0", "spatie/laravel-permission": "^3.0", "spatie/laravel-query-builder": "^3.0", - "torann/geoip": "^3.0" + "torann/geoip": "^3.0", + "tymon/jwt-auth": "dev-develop" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.7", @@ -42,11 +43,10 @@ "phpunit/phpunit": "^9.0" }, "autoload": { - "classmap": [ - "database/seeds" - ], "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { @@ -76,6 +76,6 @@ "sort-packages": true, "optimize-autoloader": true }, - "minimum-stability": "stable", + "minimum-stability": "dev", "prefer-stable": true } diff --git a/default-structure/composer.lock b/default-structure/composer.lock index 8c85c90..9884ccd 100644 --- a/default-structure/composer.lock +++ b/default-structure/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1376e5ea6090286070845fe2e783c3e4", + "content-hash": "4b8a8cf3f42e4874bff3b58a081bcb21", "packages": [ { "name": "aws/aws-sdk-php", @@ -96,59 +96,6 @@ }, "time": "2021-04-09T18:13:02+00:00" }, - { - "name": "bacon/bacon-qr-code", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/Bacon/BaconQrCode.git", - "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/3e9d791b67d0a2912922b7b7c7312f4b37af41e4", - "reference": "3e9d791b67d0a2912922b7b7c7312f4b37af41e4", - "shasum": "" - }, - "require": { - "dasprid/enum": "^1.0.3", - "ext-iconv": "*", - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "phly/keep-a-changelog": "^1.4", - "phpunit/phpunit": "^7 | ^8 | ^9", - "squizlabs/php_codesniffer": "^3.4" - }, - "suggest": { - "ext-imagick": "to generate QR code images" - }, - "type": "library", - "autoload": { - "psr-4": { - "BaconQrCode\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "https://dasprids.de/", - "role": "Developer" - } - ], - "description": "BaconQrCode is a QR code generator for PHP.", - "homepage": "https://github.com/Bacon/BaconQrCode", - "support": { - "issues": "https://github.com/Bacon/BaconQrCode/issues", - "source": "https://github.com/Bacon/BaconQrCode/tree/2.0.3" - }, - "time": "2020-10-30T02:02:47+00:00" - }, { "name": "brick/math", "version": "0.9.2", @@ -205,53 +152,6 @@ ], "time": "2021-01-20T22:51:39+00:00" }, - { - "name": "dasprid/enum", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/DASPRiD/Enum.git", - "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/DASPRiD/Enum/zipball/5abf82f213618696dda8e3bf6f64dd042d8542b2", - "reference": "5abf82f213618696dda8e3bf6f64dd042d8542b2", - "shasum": "" - }, - "require-dev": { - "phpunit/phpunit": "^7 | ^8 | ^9", - "squizlabs/php_codesniffer": "^3.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "DASPRiD\\Enum\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Ben Scholzen 'DASPRiD'", - "email": "mail@dasprids.de", - "homepage": "https://dasprids.de/", - "role": "Developer" - } - ], - "description": "PHP 7.1 enum implementation", - "keywords": [ - "enum", - "map" - ], - "support": { - "issues": "https://github.com/DASPRiD/Enum/issues", - "source": "https://github.com/DASPRiD/Enum/tree/1.0.3" - }, - "time": "2020-10-02T16:03:48+00:00" - }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -969,6 +869,78 @@ }, "time": "2021-03-21T16:25:00+00:00" }, + { + "name": "ibrunotome/google2fa-laravel", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/ibrunotome/google2fa-laravel.git", + "reference": "7fea2255ae7f752f2144eec93bb8ecbc9255da7b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ibrunotome/google2fa-laravel/zipball/7fea2255ae7f752f2144eec93bb8ecbc9255da7b", + "reference": "7fea2255ae7f752f2144eec93bb8ecbc9255da7b", + "shasum": "" + }, + "require": { + "laravel/framework": ">=5.2", + "php": ">=5.4", + "pragmarx/google2fa": "~5.0" + }, + "require-dev": { + "orchestra/testbench-browser-kit": "~3.4|~3.5|~3.6", + "phpunit/phpunit": "~5|~6|~7|~8" + }, + "suggest": { + "bacon/bacon-qr-code": "Required to generate inline QR Codes.", + "pragmarx/recovery": "Generate recovery codes." + }, + "type": "library", + "extra": { + "component": "package", + "frameworks": [ + "Laravel" + ], + "laravel": { + "providers": [ + "PragmaRX\\Google2FALaravel\\ServiceProvider" + ], + "aliases": { + "Google2FA": "PragmaRX\\Google2FALaravel\\Facade" + } + } + }, + "autoload": { + "psr-4": { + "PragmaRX\\Google2FALaravel\\": "src/", + "PragmaRX\\Google2FALaravel\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "description": "The pragmarx/google2fa with cache store instead sessions", + "keywords": [ + "Authentication", + "Two Factor Authentication", + "google2fa", + "laravel" + ], + "support": { + "issues": "https://github.com/ibrunotome/google2fa-laravel/issues", + "source": "https://github.com/ibrunotome/google2fa-laravel/tree/master" + }, + "time": "2020-05-17T21:40:57+00:00" + }, { "name": "jaybizzle/crawler-detect", "version": "v1.2.105", @@ -1104,69 +1076,6 @@ ], "time": "2020-06-13T08:05:20+00:00" }, - { - "name": "laravel/fortify", - "version": "v1.7.9", - "source": { - "type": "git", - "url": "https://github.com/laravel/fortify.git", - "reference": "9ba71f3e448ae44370bdfe72f19952e23b4d6191" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/fortify/zipball/9ba71f3e448ae44370bdfe72f19952e23b4d6191", - "reference": "9ba71f3e448ae44370bdfe72f19952e23b4d6191", - "shasum": "" - }, - "require": { - "bacon/bacon-qr-code": "^2.0", - "ext-json": "*", - "illuminate/support": "^8.0", - "php": "^7.3|^8.0", - "pragmarx/google2fa": "^7.0|^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "orchestra/testbench": "^6.0", - "phpunit/phpunit": "^9.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - }, - "laravel": { - "providers": [ - "Laravel\\Fortify\\FortifyServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Laravel\\Fortify\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Backend controllers and scaffolding for Laravel authentication.", - "keywords": [ - "auth", - "laravel" - ], - "support": { - "issues": "https://github.com/laravel/fortify/issues", - "source": "https://github.com/laravel/fortify" - }, - "time": "2021-03-30T21:12:39+00:00" - }, { "name": "laravel/framework", "version": "v8.36.2", @@ -1413,30 +1322,33 @@ "time": "2021-04-06T14:17:52+00:00" }, { - "name": "laravel/sanctum", - "version": "v2.9.4", + "name": "laravel/tinker", + "version": "v2.6.1", "source": { "type": "git", - "url": "https://github.com/laravel/sanctum.git", - "reference": "dd84a9141012c5509922df0c72866110f45026cb" + "url": "https://github.com/laravel/tinker.git", + "reference": "04ad32c1a3328081097a181875733fa51f402083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sanctum/zipball/dd84a9141012c5509922df0c72866110f45026cb", - "reference": "dd84a9141012c5509922df0c72866110f45026cb", + "url": "https://api.github.com/repos/laravel/tinker/zipball/04ad32c1a3328081097a181875733fa51f402083", + "reference": "04ad32c1a3328081097a181875733fa51f402083", "shasum": "" }, "require": { - "ext-json": "*", - "illuminate/contracts": "^6.9|^7.0|^8.0", - "illuminate/database": "^6.9|^7.0|^8.0", - "illuminate/support": "^6.9|^7.0|^8.0", - "php": "^7.2|^8.0" + "illuminate/console": "^6.0|^7.0|^8.0", + "illuminate/contracts": "^6.0|^7.0|^8.0", + "illuminate/support": "^6.0|^7.0|^8.0", + "php": "^7.2.5|^8.0", + "psy/psysh": "^0.10.4", + "symfony/var-dumper": "^4.3.4|^5.0" }, "require-dev": { - "mockery/mockery": "^1.0", - "orchestra/testbench": "^4.0|^5.0|^6.0", - "phpunit/phpunit": "^8.0|^9.3" + "mockery/mockery": "~1.3.3|^1.4.2", + "phpunit/phpunit": "^8.5.8|^9.3.3" + }, + "suggest": { + "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0)." }, "type": "library", "extra": { @@ -1445,13 +1357,13 @@ }, "laravel": { "providers": [ - "Laravel\\Sanctum\\SanctumServiceProvider" + "Laravel\\Tinker\\TinkerServiceProvider" ] } }, "autoload": { "psr-4": { - "Laravel\\Sanctum\\": "src/" + "Laravel\\Tinker\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1464,61 +1376,54 @@ "email": "taylor@laravel.com" } ], - "description": "Laravel Sanctum provides a featherweight authentication system for SPAs and simple APIs.", + "description": "Powerful REPL for the Laravel framework.", "keywords": [ - "auth", + "REPL", + "Tinker", "laravel", - "sanctum" + "psysh" ], "support": { - "issues": "https://github.com/laravel/sanctum/issues", - "source": "https://github.com/laravel/sanctum" + "issues": "https://github.com/laravel/tinker/issues", + "source": "https://github.com/laravel/tinker/tree/v2.6.1" }, - "time": "2021-04-06T14:32:48+00:00" + "time": "2021-03-02T16:53:12+00:00" }, { - "name": "laravel/tinker", - "version": "v2.6.1", + "name": "laravel/ui", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/laravel/tinker.git", - "reference": "04ad32c1a3328081097a181875733fa51f402083" + "url": "https://github.com/laravel/ui.git", + "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/04ad32c1a3328081097a181875733fa51f402083", - "reference": "04ad32c1a3328081097a181875733fa51f402083", + "url": "https://api.github.com/repos/laravel/ui/zipball/a1f82c6283c8373ea1958b8a27c3d5c98cade351", + "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351", "shasum": "" }, "require": { - "illuminate/console": "^6.0|^7.0|^8.0", - "illuminate/contracts": "^6.0|^7.0|^8.0", - "illuminate/support": "^6.0|^7.0|^8.0", - "php": "^7.2.5|^8.0", - "psy/psysh": "^0.10.4", - "symfony/var-dumper": "^4.3.4|^5.0" - }, - "require-dev": { - "mockery/mockery": "~1.3.3|^1.4.2", - "phpunit/phpunit": "^8.5.8|^9.3.3" - }, - "suggest": { - "illuminate/database": "The Illuminate Database package (^6.0|^7.0|^8.0)." + "illuminate/console": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-master": "3.x-dev" }, "laravel": { "providers": [ - "Laravel\\Tinker\\TinkerServiceProvider" + "Laravel\\Ui\\UiServiceProvider" ] } }, "autoload": { "psr-4": { - "Laravel\\Tinker\\": "src/" + "Laravel\\Ui\\": "src/", + "Illuminate\\Foundation\\Auth\\": "auth-backend/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1531,18 +1436,78 @@ "email": "taylor@laravel.com" } ], - "description": "Powerful REPL for the Laravel framework.", + "description": "Laravel UI utilities and presets.", "keywords": [ - "REPL", - "Tinker", "laravel", - "psysh" + "ui" ], "support": { - "issues": "https://github.com/laravel/tinker/issues", - "source": "https://github.com/laravel/tinker/tree/v2.6.1" + "issues": "https://github.com/laravel/ui/issues", + "source": "https://github.com/laravel/ui/tree/v3.2.0" }, - "time": "2021-03-02T16:53:12+00:00" + "time": "2021-01-06T19:20:22+00:00" + }, + { + "name": "lcobucci/jwt", + "version": "3.2.5", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "82be04b4753f8b7693b62852b7eab30f97524f9b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/82be04b4753f8b7693b62852b7eab30f97524f9b", + "reference": "82be04b4753f8b7693b62852b7eab30f97524f9b", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "php": ">=5.5" + }, + "require-dev": { + "mdanter/ecc": "~0.3.1", + "mikey179/vfsstream": "~1.5", + "phpmd/phpmd": "~2.2", + "phpunit/php-invoker": "~1.1", + "phpunit/phpunit": "~4.5", + "squizlabs/php_codesniffer": "~2.3" + }, + "suggest": { + "mdanter/ecc": "Required to use Elliptic Curves based algorithms." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Otávio Cobucci Oblonczyk", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "support": { + "issues": "https://github.com/lcobucci/jwt/issues", + "source": "https://github.com/lcobucci/jwt/tree/3.2" + }, + "time": "2018-11-11T12:22:26+00:00" }, { "name": "league/commonmark", @@ -2132,6 +2097,73 @@ }, "time": "2020-07-31T21:01:56+00:00" }, + { + "name": "namshi/jose", + "version": "7.2.3", + "source": { + "type": "git", + "url": "https://github.com/namshi/jose.git", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/namshi/jose/zipball/89a24d7eb3040e285dd5925fcad992378b82bcff", + "reference": "89a24d7eb3040e285dd5925fcad992378b82bcff", + "shasum": "" + }, + "require": { + "ext-date": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*", + "php": ">=5.5", + "symfony/polyfill-php56": "^1.0" + }, + "require-dev": { + "phpseclib/phpseclib": "^2.0", + "phpunit/phpunit": "^4.5|^5.0", + "satooshi/php-coveralls": "^1.0" + }, + "suggest": { + "ext-openssl": "Allows to use OpenSSL as crypto engine.", + "phpseclib/phpseclib": "Allows to use Phpseclib as crypto engine, use version ^2.0." + }, + "type": "library", + "autoload": { + "psr-4": { + "Namshi\\JOSE\\": "src/Namshi/JOSE/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Nadalin", + "email": "alessandro.nadalin@gmail.com" + }, + { + "name": "Alessandro Cinelli (cirpo)", + "email": "alessandro.cinelli@gmail.com" + } + ], + "description": "JSON Object Signing and Encryption library for PHP.", + "keywords": [ + "JSON Web Signature", + "JSON Web Token", + "JWS", + "json", + "jwt", + "token" + ], + "support": { + "issues": "https://github.com/namshi/jose/issues", + "source": "https://github.com/namshi/jose/tree/master" + }, + "time": "2016-12-05T07:27:31+00:00" + }, { "name": "nesbot/carbon", "version": "2.46.0", @@ -2500,6 +2532,56 @@ }, "time": "2020-12-06T15:14:20+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "phpoption/phpoption", "version": "1.7.5", @@ -2571,30 +2653,38 @@ }, { "name": "pragmarx/google2fa", - "version": "8.0.0", + "version": "v5.0.0", "source": { "type": "git", "url": "https://github.com/antonioribeiro/google2fa.git", - "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b" + "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/26c4c5cf30a2844ba121760fd7301f8ad240100b", - "reference": "26c4c5cf30a2844ba121760fd7301f8ad240100b", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/17c969c82f427dd916afe4be50bafc6299aef1b4", + "reference": "17c969c82f427dd916afe4be50bafc6299aef1b4", "shasum": "" }, "require": { - "paragonie/constant_time_encoding": "^1.0|^2.0", - "php": "^7.1|^8.0" + "paragonie/constant_time_encoding": "~1.0|~2.0", + "paragonie/random_compat": ">=1", + "php": ">=5.4", + "symfony/polyfill-php56": "~1.2" }, "require-dev": { - "phpstan/phpstan": "^0.12.18", - "phpunit/phpunit": "^7.5.15|^8.5|^9.0" + "phpunit/phpunit": "~4|~5|~6" }, "type": "library", + "extra": { + "component": "package", + "branch-alias": { + "dev-master": "2.0-dev" + } + }, "autoload": { "psr-4": { - "PragmaRX\\Google2FA\\": "src/" + "PragmaRX\\Google2FA\\": "src/", + "PragmaRX\\Google2FA\\Tests\\": "tests/" } }, "notification-url": "https://packagist.org/downloads/", @@ -2617,9 +2707,9 @@ ], "support": { "issues": "https://github.com/antonioribeiro/google2fa/issues", - "source": "https://github.com/antonioribeiro/google2fa/tree/8.0.0" + "source": "https://github.com/antonioribeiro/google2fa/tree/master" }, - "time": "2020-04-05T10:47:18+00:00" + "time": "2019-03-19T22:44:16+00:00" }, { "name": "psr/container", @@ -4797,6 +4887,74 @@ ], "time": "2021-01-22T09:19:47+00:00" }, + { + "name": "symfony/polyfill-php56", + "version": "v1.20.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "reference": "54b8cd7e6c1643d78d011f3be89f3ef1f9f4c675", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "metapackage", + "extra": { + "branch-alias": { + "dev-main": "1.20-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php56/tree/v1.20.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T14:02:19+00:00" + }, { "name": "symfony/polyfill-php72", "version": "v1.22.1", @@ -5741,6 +5899,92 @@ }, "time": "2020-12-21T19:12:11+00:00" }, + { + "name": "tymon/jwt-auth", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/tymondesigns/jwt-auth.git", + "reference": "ab00f2d7cce5f043067aef7849cdc792de2df635" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/ab00f2d7cce5f043067aef7849cdc792de2df635", + "reference": "ab00f2d7cce5f043067aef7849cdc792de2df635", + "shasum": "" + }, + "require": { + "illuminate/auth": "^5.2|^6|^7|^8", + "illuminate/contracts": "^5.2|^6|^7|^8", + "illuminate/http": "^5.2|^6|^7|^8", + "illuminate/support": "^5.2|^6|^7|^8", + "lcobucci/jwt": "<3.4", + "namshi/jose": "^7.0", + "nesbot/carbon": "^1.0|^2.0", + "php": "^7.2|^8.0" + }, + "require-dev": { + "illuminate/console": "^5.2|^6|^7|^8", + "illuminate/database": "^5.2|^6|^7|^8", + "illuminate/routing": "^5.2|^6|^7|^8", + "mockery/mockery": ">=0.9.9", + "phpunit/phpunit": "^8.5|^9.4", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.0-dev" + }, + "laravel": { + "aliases": { + "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", + "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" + }, + "providers": [ + "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Tymon\\JWTAuth\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sean Tymon", + "email": "tymon148@gmail.com", + "homepage": "https://tymon.xyz", + "role": "Developer" + } + ], + "description": "JSON Web Token Authentication for Laravel and Lumen", + "homepage": "https://github.com/tymondesigns/jwt-auth", + "keywords": [ + "Authentication", + "JSON Web Token", + "auth", + "jwt", + "laravel" + ], + "support": { + "issues": "https://github.com/tymondesigns/jwt-auth/issues", + "source": "https://github.com/tymondesigns/jwt-auth" + }, + "funding": [ + { + "url": "https://www.patreon.com/seantymon", + "type": "patreon" + } + ], + "time": "2021-02-02T14:44:28+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.3.0", @@ -11100,8 +11344,9 @@ } ], "aliases": [], - "minimum-stability": "stable", + "minimum-stability": "dev", "stability-flags": { + "tymon/jwt-auth": 20, "nunomaduro/phpinsights": 20 }, "prefer-stable": true, diff --git a/default-structure/config/app.php b/default-structure/config/app.php index 07128a6..57c7557 100644 --- a/default-structure/config/app.php +++ b/default-structure/config/app.php @@ -180,10 +180,10 @@ */ App\Providers\AppServiceProvider::class, App\Providers\AuthServiceProvider::class, - App\Providers\FortifyServiceProvider::class, // App\Providers\BroadcastServiceProvider::class, App\Providers\EventServiceProvider::class, App\Providers\RouteServiceProvider::class, + App\Providers\RepositoryServiceProvider::class, ], diff --git a/default-structure/config/auth.php b/default-structure/config/auth.php index ba1a4d8..7cc99c5 100644 --- a/default-structure/config/auth.php +++ b/default-structure/config/auth.php @@ -14,7 +14,7 @@ */ 'defaults' => [ - 'guard' => 'web', + 'guard' => 'api', 'passwords' => 'users', ], @@ -36,15 +36,9 @@ */ 'guards' => [ - 'web' => [ - 'driver' => 'session', - 'provider' => 'users', - ], - 'api' => [ - 'driver' => 'token', + 'driver' => 'jwt', 'provider' => 'users', - 'hash' => false, ], ], @@ -68,7 +62,7 @@ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Models\User::class, + 'model' => App\Models\User::class, ], // 'users' => [ @@ -95,8 +89,8 @@ 'passwords' => [ 'users' => [ 'provider' => 'users', - 'table' => 'password_resets', - 'expire' => 60, + 'table' => 'password_resets', + 'expire' => 60, 'throttle' => 60, ], ], diff --git a/default-structure/config/fortify.php b/default-structure/config/fortify.php deleted file mode 100644 index d3fd70a..0000000 --- a/default-structure/config/fortify.php +++ /dev/null @@ -1,145 +0,0 @@ - 'web', - - /* - |-------------------------------------------------------------------------- - | Fortify Password Broker - |-------------------------------------------------------------------------- - | - | Here you may specify which password broker Fortify can use when a user - | is resetting their password. This configured value should match one - | of your password brokers setup in your "auth" configuration file. - | - */ - - 'passwords' => 'users', - - /* - |-------------------------------------------------------------------------- - | Username / Email - |-------------------------------------------------------------------------- - | - | This value defines which model attribute should be considered as your - | application's "username" field. Typically, this might be the email - | address of the users but you are free to change this value here. - | - | Out of the box, Fortify expects forgot password and reset password - | requests to have a field named 'email'. If the application uses - | another name for the field you may define it below as needed. - | - */ - - 'username' => 'email', - - 'email' => 'email', - - /* - |-------------------------------------------------------------------------- - | Home Path - |-------------------------------------------------------------------------- - | - | Here you may configure the path where users will get redirected during - | authentication or password reset when the operations are successful - | and the user is authenticated. You are free to change this value. - | - */ - - 'home' => env('SPA_URL') . '/dashboard', - - /* - |-------------------------------------------------------------------------- - | Fortify Routes Prefix / Subdomain - |-------------------------------------------------------------------------- - | - | Here you may specify which prefix Fortify will assign to all the routes - | that it registers with the application. If necessary, you may change - | subdomain under which all of the Fortify routes will be available. - | - */ - - 'prefix' => '', - - 'domain' => null, - - /* - |-------------------------------------------------------------------------- - | Fortify Routes Middleware - |-------------------------------------------------------------------------- - | - | Here you may specify which middleware Fortify will assign to the routes - | that it registers with the application. If necessary, you may change - | these middleware but typically this provided default is preferred. - | - */ - - 'middleware' => ['web'], - - /* - |-------------------------------------------------------------------------- - | Rate Limiting - |-------------------------------------------------------------------------- - | - | By default, Fortify will throttle logins to five requests per minute for - | every email and IP address combination. However, if you would like to - | specify a custom rate limiter to call then you may specify it here. - | - */ - - 'limiters' => [ - 'login' => 'login', - 'two-factor' => 'two-factor', - ], - - /* - |-------------------------------------------------------------------------- - | Register View Routes - |-------------------------------------------------------------------------- - | - | Here you may specify if the routes returning views should be disabled as - | you may not need them when building your own application. This may be - | especially true if you're writing a custom single-page application. - | - */ - - 'views' => false, - - /* - |-------------------------------------------------------------------------- - | Features - |-------------------------------------------------------------------------- - | - | Some of the Fortify features are optional. You may disable the features - | by removing them from this array. You're free to only remove some of - | these features or you can even remove all of these if you need to. - | - */ - - 'features' => [ - Features::registration(), - Features::resetPasswords(), - // Features::emailVerification(), - Features::updateProfileInformation(), - Features::updatePasswords(), - Features::twoFactorAuthentication([ - 'confirmPassword' => true, - ]), - ], - -]; diff --git a/default-structure/config/sanctum.php b/default-structure/config/sanctum.php deleted file mode 100644 index 3ccc3ca..0000000 --- a/default-structure/config/sanctum.php +++ /dev/null @@ -1,50 +0,0 @@ - explode(',', env( - 'SANCTUM_STATEFUL_DOMAINS', - 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1,'.parse_url(env('APP_URL'), PHP_URL_HOST) - )), - - /* - |-------------------------------------------------------------------------- - | Expiration Minutes - |-------------------------------------------------------------------------- - | - | This value controls the number of minutes until an issued token will be - | considered expired. If this value is null, personal access tokens do - | not expire. This won't tweak the lifetime of first-party sessions. - | - */ - - 'expiration' => null, - - /* - |-------------------------------------------------------------------------- - | Sanctum Middleware - |-------------------------------------------------------------------------- - | - | When authenticating your first-party SPA with Sanctum you may need to - | customize some of the middleware Sanctum uses while processing the - | request. You may change the middleware listed below as required. - | - */ - - 'middleware' => [ - 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, - 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, - ], - -]; diff --git a/default-structure/database/seeds/DatabaseSeeder.php b/default-structure/database/seeders/DatabaseSeeder.php similarity index 100% rename from default-structure/database/seeds/DatabaseSeeder.php rename to default-structure/database/seeders/DatabaseSeeder.php diff --git a/default-structure/database/seeds/PermissionsTableSeeder.php b/default-structure/database/seeders/PermissionsTableSeeder.php similarity index 100% rename from default-structure/database/seeds/PermissionsTableSeeder.php rename to default-structure/database/seeders/PermissionsTableSeeder.php diff --git a/default-structure/database/seeds/RolesTableSeeder.php b/default-structure/database/seeders/RolesTableSeeder.php similarity index 100% rename from default-structure/database/seeds/RolesTableSeeder.php rename to default-structure/database/seeders/RolesTableSeeder.php diff --git a/default-structure/database/seeds/UsersTableSeed.php b/default-structure/database/seeders/UsersTableSeed.php similarity index 100% rename from default-structure/database/seeds/UsersTableSeed.php rename to default-structure/database/seeders/UsersTableSeed.php diff --git a/default-structure/php.testing.ini b/default-structure/php.testing.ini index 71eaadb..b389677 100644 --- a/default-structure/php.testing.ini +++ b/default-structure/php.testing.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,4 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so \ No newline at end of file diff --git a/default-structure/routes/api.php b/default-structure/routes/api.php index c823062..d3d2229 100644 --- a/default-structure/routes/api.php +++ b/default-structure/routes/api.php @@ -30,11 +30,11 @@ Route::group(['middleware' => 'guest'], function () { Route::post('email/verify/{token}', [EmailVerificationController::class, 'verify']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.email.verify'); Route::post('devices/authorize/{token}', [AuthorizeDeviceController::class, 'authorizeDevice']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.device.authorize'); Route::post('login', [LoginController::class, 'login']) @@ -44,11 +44,11 @@ ->name('api.auth.register'); Route::post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.reset.email-link'); Route::post('password/reset', [ResetPasswordController::class, 'reset']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.reset.password'); }); @@ -113,7 +113,7 @@ ->name('api.notifications.visualize'); Route::delete('devices/{id}', [AuthorizeDeviceController::class, 'destroy']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.device.destroy'); }); @@ -121,5 +121,5 @@ ->name('api.server.ping'); Route::post('/account/disable/{token}', [DisableAccountController::class, 'disable']) - ->middleware('throttle:5,1') + ->middleware(['throttle:hard']) ->name('api.account.disable'); diff --git a/default-structure/tests/Feature/AuthorizeDeviceControllerTest.php b/default-structure/tests/Feature/AuthorizeDeviceControllerTest.php index 5411850..c7d6e2b 100644 --- a/default-structure/tests/Feature/AuthorizeDeviceControllerTest.php +++ b/default-structure/tests/Feature/AuthorizeDeviceControllerTest.php @@ -12,20 +12,12 @@ class AuthorizeDeviceControllerTest extends TestCase { public function testAuthorizeDevice() { - /** - * @var User $user - */ - $user = factory(User::class)->states([ - 'email_unverified', - ])->create([ + $user = User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); - /** - * @var AuthorizedDevice $authorizedDevice - */ - $authorizedDevice = factory(AuthorizedDevice::class)->create([ + $authorizedDevice = AuthorizedDevice::factory()->create([ 'device' => 'device', 'platform' => 'platform', 'platform_version' => 'platform_version', @@ -42,12 +34,8 @@ public function testAuthorizeDevice() public function testCannotAuthorizeDeviceBecauseItsAlreadyAuthorized() { - /** - * @var User $user - */ - factory(User::class)->states([ - 'email_unverified', - ])->create([ + + User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); @@ -59,20 +47,12 @@ public function testCannotAuthorizeDeviceBecauseItsAlreadyAuthorized() public function testDestroyAuthorizedDevice() { - /** - * @var User $user - */ - $user = factory(User::class)->states([ - 'email_unverified', - ])->create([ + $user = User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); - /** - * @var AuthorizedDevice $authorizedDevice - */ - $authorizedDevice = factory(AuthorizedDevice::class)->create([ + $authorizedDevice = AuthorizedDevice::factory()->create([ 'device' => 'device', 'platform' => 'platform', 'platform_version' => 'platform_version', diff --git a/default-structure/tests/Feature/DisableAccountControllerTest.php b/default-structure/tests/Feature/DisableAccountControllerTest.php index 14c9143..da72eea 100644 --- a/default-structure/tests/Feature/DisableAccountControllerTest.php +++ b/default-structure/tests/Feature/DisableAccountControllerTest.php @@ -10,7 +10,7 @@ class DisableAccountControllerTest extends TestCase { public function testDisableAccount() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->postJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertOk() @@ -19,7 +19,7 @@ public function testDisableAccount() public function testDisableAccountWillFailBecauseMethodNotAllowed() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->putJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertStatus(Response::HTTP_METHOD_NOT_ALLOWED) @@ -28,7 +28,7 @@ public function testDisableAccountWillFailBecauseMethodNotAllowed() public function testTooManyRequests() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->postJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertOk(); diff --git a/default-structure/tests/Feature/LoginControllerTest.php b/default-structure/tests/Feature/LoginControllerTest.php index 7536403..73259ae 100644 --- a/default-structure/tests/Feature/LoginControllerTest.php +++ b/default-structure/tests/Feature/LoginControllerTest.php @@ -14,7 +14,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testLogin() @@ -68,7 +68,7 @@ public function testLogout() public function testCannotLoginBecauseEmailIsNotVerified() { - $this->user = factory(User::class)->states('email_unverified')->create(); + $this->user = User::factory()->emailUnverified()->create(); $this ->postJson(route('api.auth.login'), [ @@ -80,7 +80,7 @@ public function testCannotLoginBecauseEmailIsNotVerified() public function testCannotLoginBecauseAccountIsInactive() { - $this->user = factory(User::class)->states('inactive')->create(); + $this->user = User::factory()->inactive()->create(); $this ->postJson(route('api.auth.login'), [ diff --git a/default-structure/tests/Feature/NotificationControllerTest.php b/default-structure/tests/Feature/NotificationControllerTest.php index 12c95a6..cb3818c 100644 --- a/default-structure/tests/Feature/NotificationControllerTest.php +++ b/default-structure/tests/Feature/NotificationControllerTest.php @@ -13,7 +13,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testVisualizeAllNotifications() diff --git a/default-structure/tests/Feature/PasswordResetListenerTest.php b/default-structure/tests/Feature/PasswordResetListenerTest.php index a66056f..f02efa7 100644 --- a/default-structure/tests/Feature/PasswordResetListenerTest.php +++ b/default-structure/tests/Feature/PasswordResetListenerTest.php @@ -18,7 +18,7 @@ public function setUp(): void parent::setUp(); $this->passwordResetListener = $this->app->make(PasswordResetListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/default-structure/tests/Feature/RegisterControllerTest.php b/default-structure/tests/Feature/RegisterControllerTest.php index ee9ddf0..11315fd 100644 --- a/default-structure/tests/Feature/RegisterControllerTest.php +++ b/default-structure/tests/Feature/RegisterControllerTest.php @@ -59,7 +59,7 @@ public function testCannotRegisterBecausePasswordsNotMatch() public function testCannotRegisterBecauseEmailAlreadyRegistered() { - factory(User::class)->create([ + User::factory()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); @@ -75,10 +75,7 @@ public function testCannotRegisterBecauseEmailAlreadyRegistered() public function testVerifyEmail() { - /** - * @var User $user - */ - $user = factory(User::class)->create([ + $user = User::factory()->create([ 'is_active' => 1, 'email_verified_at' => null, 'email_token_confirmation' => Uuid::uuid4(), @@ -93,7 +90,7 @@ public function testVerifyEmail() public function testInvalidVerifyEmailToken() { - factory(User::class)->create([ + User::factory()->create([ 'is_active' => 1, 'email_verified_at' => null, 'email' => 'test@test.com', diff --git a/default-structure/tests/Feature/ResetPasswordControllerTest.php b/default-structure/tests/Feature/ResetPasswordControllerTest.php index fe80489..ad50bc5 100644 --- a/default-structure/tests/Feature/ResetPasswordControllerTest.php +++ b/default-structure/tests/Feature/ResetPasswordControllerTest.php @@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Password; use Tests\TestCase; -class PasswordResetTest extends TestCase +class ResetPasswordControllerTest extends TestCase { use WithFaker; @@ -21,7 +21,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testSubmitPasswordReset() diff --git a/default-structure/tests/Feature/TwoFactorAuthenticationControllerTest.php b/default-structure/tests/Feature/TwoFactorAuthenticationControllerTest.php index 48ba595..b07e878 100644 --- a/default-structure/tests/Feature/TwoFactorAuthenticationControllerTest.php +++ b/default-structure/tests/Feature/TwoFactorAuthenticationControllerTest.php @@ -15,7 +15,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testGenerate2faSecret() diff --git a/default-structure/tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php b/default-structure/tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php index 071aede..a35e5eb 100644 --- a/default-structure/tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php +++ b/default-structure/tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php @@ -18,7 +18,7 @@ public function setUp(): void parent::setUp(); $this->twoFactorAuthenticationWasDisabledListener = $this->app->make(TwoFactorAuthenticationWasDisabledListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/default-structure/tests/Feature/UserControllerTest.php b/default-structure/tests/Feature/UserControllerTest.php index 9446152..5fdbc9d 100644 --- a/default-structure/tests/Feature/UserControllerTest.php +++ b/default-structure/tests/Feature/UserControllerTest.php @@ -19,7 +19,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } /** @@ -106,8 +106,8 @@ public function testShowMe() 'unreadnotifications', ]; - factory(LoginHistory::class)->create(['user_id' => $this->user->id]); - factory(AuthorizedDevice::class)->create(['user_id' => $this->user->id]); + LoginHistory::factory()->create(['user_id' => $this->user->id]); + AuthorizedDevice::factory()->create(['user_id' => $this->user->id]); $this->actingAs($this->user) ->getJson(route('api.me') . '?include=' . implode(',', $includes)) @@ -134,9 +134,9 @@ public function testShow() 'unreadnotifications', ]; - $user2 = factory(User::class)->create(); - factory(LoginHistory::class)->create(['user_id' => $user2->id]); - factory(AuthorizedDevice::class)->create(['user_id' => $user2->id]); + $user2 = User::factory()->create(); + LoginHistory::factory()->create(['user_id' => $user2->id]); + AuthorizedDevice::factory()->create(['user_id' => $user2->id]); $this ->actingAs($this->user) @@ -183,7 +183,7 @@ public function testCannotShowBecauseUnauthenticated() */ public function testCannotShowBecauseUnauthorized() { - $user2 = factory(User::class)->create(); + $user2 = User::factory()->create(); $this ->actingAs($this->user) @@ -217,7 +217,7 @@ public function testCannotUpdateBecauseUnauthorized() { Permission::create(['name' => 'update users']); - $user2 = factory(User::class)->create(); + $user2 = User::factory()->create(); $this ->actingAs($this->user) diff --git a/default-structure/tests/Feature/UserRegisteredListenerTest.php b/default-structure/tests/Feature/UserRegisteredListenerTest.php index 751b93c..9f0a9fb 100644 --- a/default-structure/tests/Feature/UserRegisteredListenerTest.php +++ b/default-structure/tests/Feature/UserRegisteredListenerTest.php @@ -20,7 +20,7 @@ public function setUp(): void parent::setUp(); $this->userRegisteredListener = $this->app->make(UserRegisteredListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/default-structure/tests/Unit/AuthorizedDeviceTest.php b/default-structure/tests/Unit/AuthorizedDeviceTest.php index fc5adcb..7f8dc01 100644 --- a/default-structure/tests/Unit/AuthorizedDeviceTest.php +++ b/default-structure/tests/Unit/AuthorizedDeviceTest.php @@ -14,8 +14,8 @@ public function setUp(): void { parent::setUp(); - $user = factory(User::class)->create(); - $this->authorizedDevice = factory(AuthorizedDevice::class)->make(['user_id' => $user->id]); + $user = User::factory()->create(); + $this->authorizedDevice = AuthorizedDevice::factory()->make(['user_id' => $user->id]); } public function testUserRelationship() diff --git a/default-structure/tests/Unit/CurrentPasswordRuleTest.php b/default-structure/tests/Unit/CurrentPasswordRuleTest.php index cda2015..831f896 100644 --- a/default-structure/tests/Unit/CurrentPasswordRuleTest.php +++ b/default-structure/tests/Unit/CurrentPasswordRuleTest.php @@ -16,7 +16,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); $this->rule = new CurrentPasswordRule(); } diff --git a/default-structure/tests/Unit/LoginHistoryTest.php b/default-structure/tests/Unit/LoginHistoryTest.php index b5b4652..acce4fd 100644 --- a/default-structure/tests/Unit/LoginHistoryTest.php +++ b/default-structure/tests/Unit/LoginHistoryTest.php @@ -14,8 +14,8 @@ public function setUp(): void { parent::setUp(); - $user = factory(User::class)->create(); - $this->loginHistory = factory(LoginHistory::class)->make(['user_id' => $user->id]); + $user = User::factory()->create(); + $this->loginHistory = LoginHistory::factory()->make(['user_id' => $user->id]); } public function testUserRelationship() diff --git a/default-structure/tests/Unit/NotificationsTest.php b/default-structure/tests/Unit/NotificationsTest.php index ad1e437..6aab70f 100644 --- a/default-structure/tests/Unit/NotificationsTest.php +++ b/default-structure/tests/Unit/NotificationsTest.php @@ -21,7 +21,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testVerifyEmailNotification() diff --git a/default-structure/tests/Unit/UserRepositoryTest.php b/default-structure/tests/Unit/UserRepositoryTest.php index 47ca616..4ee516e 100644 --- a/default-structure/tests/Unit/UserRepositoryTest.php +++ b/default-structure/tests/Unit/UserRepositoryTest.php @@ -16,7 +16,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); $this->userRepository = $this->app->make(UserRepository::class); } diff --git a/default-structure/tests/Unit/UserTest.php b/default-structure/tests/Unit/UserTest.php index 8fd0352..2397cd9 100644 --- a/default-structure/tests/Unit/UserTest.php +++ b/default-structure/tests/Unit/UserTest.php @@ -15,18 +15,18 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testLoginHistoriesRelationship() { - factory(LoginHistory::class)->create(['user_id' => $this->user->id]); + LoginHistory::factory()->create(['user_id' => $this->user->id]); $this->assertNotNull($this->user->loginHistories); } public function testAuthorizedDevicesRelationship() { - factory(AuthorizedDevice::class)->create(['user_id' => $this->user->id]); + AuthorizedDevice::factory()->create(['user_id' => $this->user->id]); $this->assertNotNull($this->user->authorizedDevices); } } From a64823f848620b70d107fe6e31b39d575034033e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sat, 17 Apr 2021 20:39:07 -0300 Subject: [PATCH 3/8] refactor: enforce typed properties and typed returns --- .../Contracts/AuthorizedDeviceRepository.php | 5 +- .../Controllers/NotificationController.php | 5 +- .../app/Http/Controllers/UserController.php | 42 +++--------- .../app/Http/Controllers/UtilController.php | 3 +- .../app/Http/Middleware/Authenticate.php | 2 +- .../app/Http/Middleware/SetLocale.php | 2 +- .../app/Http/Middleware/TrustProxies.php | 2 +- .../DisableTwoFactorAuthenticationRequest.php | 4 +- .../EnableTwoFactorAuthenticationRequest.php | 4 +- .../Http/Requests/PasswordUpdateRequest.php | 4 +- .../app/Http/Requests/UserUpdateRequest.php | 4 +- .../Resources/AuthorizedDeviceResource.php | 2 +- .../Http/Resources/LoginHistoryResource.php | 2 +- .../Http/Resources/NotificationResource.php | 2 +- .../app/Http/Resources/UserCollection.php | 2 +- .../app/Http/Resources/UserResource.php | 2 +- default-structure/app/Http/ResponseTrait.php | 12 ---- default-structure/app/Models/Audit.php | 30 ++++---- .../app/Models/AuthorizedDevice.php | 39 +++++------ default-structure/app/Models/LoginHistory.php | 39 +++++------ default-structure/app/Models/Permission.php | 30 ++++---- default-structure/app/Models/Role.php | 22 +++--- default-structure/app/Models/User.php | 68 +++++++++++-------- .../AccountDisabledNotification.php | 4 +- .../AuthorizeDeviceNotification.php | 4 +- .../PasswordChangedNotification.php | 4 +- .../ResetPasswordNotification.php | 4 +- .../SuccessfulLoginFromIpNotification.php | 4 +- ...rAuthenticationWasDisabledNotification.php | 4 +- .../Notifications/VerifyEmailNotification.php | 4 +- .../app/Policies/AuthorizedDevicePolicy.php | 36 ++-------- .../app/Policies/LoginHistoryPolicy.php | 31 ++------- .../app/Policies/PermissionPolicy.php | 35 ++-------- default-structure/app/Policies/RolePolicy.php | 35 ++-------- default-structure/app/Policies/UserPolicy.php | 37 ++-------- .../app/Providers/AuthServiceProvider.php | 2 +- .../Providers/RepositoryServiceProvider.php | 4 +- .../EloquentAuthorizedDevicesRepository.php | 4 +- .../app/Services/AuthorizedDeviceService.php | 4 +- .../app/Services/DisableAccountService.php | 2 +- default-structure/config/app.php | 1 + 41 files changed, 212 insertions(+), 334 deletions(-) diff --git a/default-structure/app/Contracts/AuthorizedDeviceRepository.php b/default-structure/app/Contracts/AuthorizedDeviceRepository.php index f6937e8..8de391b 100644 --- a/default-structure/app/Contracts/AuthorizedDeviceRepository.php +++ b/default-structure/app/Contracts/AuthorizedDeviceRepository.php @@ -2,9 +2,12 @@ namespace App\Contracts; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; + interface AuthorizedDeviceRepository extends BaseRepository { public function doesNotHaveAuthorizedAnyDeviceYet(string $userId): bool; - public function findDeviceByCriteria(array $data); + public function findDeviceByCriteria(array $data): Model|Builder|null; } diff --git a/default-structure/app/Http/Controllers/NotificationController.php b/default-structure/app/Http/Controllers/NotificationController.php index ba6c9ed..5e635f0 100644 --- a/default-structure/app/Http/Controllers/NotificationController.php +++ b/default-structure/app/Http/Controllers/NotificationController.php @@ -2,12 +2,13 @@ namespace App\Http\Controllers; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; use Illuminate\Support\Facades\Cache; class NotificationController extends Controller { - public function visualizeAllNotifications() + public function visualizeAllNotifications(): JsonResponse { $user = auth()->user(); @@ -18,7 +19,7 @@ public function visualizeAllNotifications() return $this->respondWithCustomData(['message' => 'OK'], Response::HTTP_OK); } - public function visualizeNotification(string $id) + public function visualizeNotification(string $id): JsonResponse { $user = auth()->user(); diff --git a/default-structure/app/Http/Controllers/UserController.php b/default-structure/app/Http/Controllers/UserController.php index bff530b..159623c 100644 --- a/default-structure/app/Http/Controllers/UserController.php +++ b/default-structure/app/Http/Controllers/UserController.php @@ -13,11 +13,8 @@ class UserController extends Controller { - private UserRepository $userRepository; - - public function __construct(UserRepository $userRepository) + public function __construct(private UserRepository $userRepository) { - $this->userRepository = $userRepository; $this->resourceItem = UserResource::class; $this->resourceCollection = UserCollection::class; $this->authorizeResource(User::class); @@ -25,10 +22,8 @@ public function __construct(UserRepository $userRepository) /** * List all users. - * - * @return \Illuminate\Http\JsonResponse */ - public function index() + public function index(): UserCollection { $cacheTag = 'users'; $cacheKey = 'users:' . auth()->id() . json_encode(request()->all()); @@ -42,24 +37,17 @@ public function index() /** * Show a current logged user. - * - * @param Request $request - * @return \Illuminate\Http\JsonResponse */ - public function profile(Request $request) + public function profile(Request $request): UserResource { - $user = auth()->user(); + $user = $request->user(); return $this->show($request, $user); } /** * Show an user. - * - * @param Request $request - * @param User $user - * @return \Illuminate\Http\JsonResponse */ - public function show(Request $request, User $user) + public function show(Request $request, User $user): UserResource { $allowedIncludes = [ 'loginhistories', @@ -84,24 +72,17 @@ public function show(Request $request, User $user) /** * Update the current logged user. - * - * @param UserUpdateRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function updateMe(UserUpdateRequest $request) + public function updateMe(UserUpdateRequest $request): UserResource { - $user = auth()->user(); + $user = $request->user(); return $this->update($request, $user); } /** * Update an user. - * - * @param UserUpdateRequest $request - * @param User $user - * @return \Illuminate\Http\JsonResponse */ - public function update(UserUpdateRequest $request, User $user) + public function update(UserUpdateRequest $request, User $user): UserResource { $data = $request->validated(); $response = $this->userRepository->update($user, $data); @@ -111,13 +92,10 @@ public function update(UserUpdateRequest $request, User $user) /** * Update password of logged user. - * - * @param PasswordUpdateRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function updatePassword(PasswordUpdateRequest $request) + public function updatePassword(PasswordUpdateRequest $request): UserResource { - $user = auth()->user(); + $user = $request->user(); $data = $request->only(['password']); $response = $this->userRepository->update($user, $data); diff --git a/default-structure/app/Http/Controllers/UtilController.php b/default-structure/app/Http/Controllers/UtilController.php index a01c935..5017c1d 100644 --- a/default-structure/app/Http/Controllers/UtilController.php +++ b/default-structure/app/Http/Controllers/UtilController.php @@ -2,11 +2,12 @@ namespace App\Http\Controllers; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class UtilController extends Controller { - public function serverTime() + public function serverTime(): JsonResponse { $now = now(); $milliseconds = substr((string)$now->micro, 0, 3); diff --git a/default-structure/app/Http/Middleware/Authenticate.php b/default-structure/app/Http/Middleware/Authenticate.php index bc3bb11..8a42588 100644 --- a/default-structure/app/Http/Middleware/Authenticate.php +++ b/default-structure/app/Http/Middleware/Authenticate.php @@ -15,7 +15,7 @@ class Authenticate extends Middleware protected function redirectTo($request) { if (!$request->expectsJson()) { - return url(env('SPA_URL') . '/login'); + return url(config('app.spa_url') . '/login'); } } } diff --git a/default-structure/app/Http/Middleware/SetLocale.php b/default-structure/app/Http/Middleware/SetLocale.php index ffd1c09..446bc6f 100644 --- a/default-structure/app/Http/Middleware/SetLocale.php +++ b/default-structure/app/Http/Middleware/SetLocale.php @@ -16,7 +16,7 @@ class SetLocale public function handle($request, Closure $next) { if (auth()->check()) { - app()->setLocale(auth()->user()->locale); + app()->setLocale($request->user()->locale); } return $next($request); diff --git a/default-structure/app/Http/Middleware/TrustProxies.php b/default-structure/app/Http/Middleware/TrustProxies.php index ee5b595..ab82a3f 100644 --- a/default-structure/app/Http/Middleware/TrustProxies.php +++ b/default-structure/app/Http/Middleware/TrustProxies.php @@ -19,5 +19,5 @@ class TrustProxies extends Middleware * * @var int */ - protected $headers = Request::HEADER_X_FORWARDED_ALL; + protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; } diff --git a/default-structure/app/Http/Requests/DisableTwoFactorAuthenticationRequest.php b/default-structure/app/Http/Requests/DisableTwoFactorAuthenticationRequest.php index 9ab44de..81b6aeb 100644 --- a/default-structure/app/Http/Requests/DisableTwoFactorAuthenticationRequest.php +++ b/default-structure/app/Http/Requests/DisableTwoFactorAuthenticationRequest.php @@ -9,7 +9,7 @@ class DisableTwoFactorAuthenticationRequest extends FormRequest * * @return bool */ - public function authorize() + public function authorize(): bool { return true; } @@ -19,7 +19,7 @@ public function authorize() * * @return array */ - public function rules() + public function rules(): array { return [ 'password' => [ diff --git a/default-structure/app/Http/Requests/EnableTwoFactorAuthenticationRequest.php b/default-structure/app/Http/Requests/EnableTwoFactorAuthenticationRequest.php index eef7a57..fb5ea99 100644 --- a/default-structure/app/Http/Requests/EnableTwoFactorAuthenticationRequest.php +++ b/default-structure/app/Http/Requests/EnableTwoFactorAuthenticationRequest.php @@ -9,7 +9,7 @@ class EnableTwoFactorAuthenticationRequest extends FormRequest * * @return bool */ - public function authorize() + public function authorize(): bool { return true; } @@ -19,7 +19,7 @@ public function authorize() * * @return array */ - public function rules() + public function rules(): array { return [ 'one_time_password' => [ diff --git a/default-structure/app/Http/Requests/PasswordUpdateRequest.php b/default-structure/app/Http/Requests/PasswordUpdateRequest.php index 3292ae5..eaf4c54 100644 --- a/default-structure/app/Http/Requests/PasswordUpdateRequest.php +++ b/default-structure/app/Http/Requests/PasswordUpdateRequest.php @@ -12,7 +12,7 @@ class PasswordUpdateRequest extends FormRequest * * @return bool */ - public function authorize() + public function authorize(): bool { return true; } @@ -22,7 +22,7 @@ public function authorize() * * @return array */ - public function rules() + public function rules(): array { return [ 'current_password' => [ diff --git a/default-structure/app/Http/Requests/UserUpdateRequest.php b/default-structure/app/Http/Requests/UserUpdateRequest.php index 4b21561..5e1d09c 100644 --- a/default-structure/app/Http/Requests/UserUpdateRequest.php +++ b/default-structure/app/Http/Requests/UserUpdateRequest.php @@ -9,7 +9,7 @@ class UserUpdateRequest extends FormRequest * * @return bool */ - public function authorize() + public function authorize(): bool { $id = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); @@ -21,7 +21,7 @@ public function authorize() * * @return array */ - public function rules() + public function rules(): array { $ignoreId = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); diff --git a/default-structure/app/Http/Resources/AuthorizedDeviceResource.php b/default-structure/app/Http/Resources/AuthorizedDeviceResource.php index e4b75cf..7d73eea 100644 --- a/default-structure/app/Http/Resources/AuthorizedDeviceResource.php +++ b/default-structure/app/Http/Resources/AuthorizedDeviceResource.php @@ -12,7 +12,7 @@ */ class AuthorizedDeviceResource extends JsonResource { - public function toArray($request) + public function toArray($request): array { if ($this->authorized_at instanceof Carbon) { $this->authorized_at = $this->authorized_at->format('Y-m-d\TH:i:s'); diff --git a/default-structure/app/Http/Resources/LoginHistoryResource.php b/default-structure/app/Http/Resources/LoginHistoryResource.php index 15ef95b..fff13a0 100644 --- a/default-structure/app/Http/Resources/LoginHistoryResource.php +++ b/default-structure/app/Http/Resources/LoginHistoryResource.php @@ -11,7 +11,7 @@ */ class LoginHistoryResource extends JsonResource { - public function toArray($request) + public function toArray($request): array { return [ 'browser' => $this->browser, diff --git a/default-structure/app/Http/Resources/NotificationResource.php b/default-structure/app/Http/Resources/NotificationResource.php index 2c9b579..06cf96c 100644 --- a/default-structure/app/Http/Resources/NotificationResource.php +++ b/default-structure/app/Http/Resources/NotificationResource.php @@ -21,7 +21,7 @@ class NotificationResource extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'id' => $this->id, diff --git a/default-structure/app/Http/Resources/UserCollection.php b/default-structure/app/Http/Resources/UserCollection.php index 632acaf..e377670 100644 --- a/default-structure/app/Http/Resources/UserCollection.php +++ b/default-structure/app/Http/Resources/UserCollection.php @@ -12,7 +12,7 @@ class UserCollection extends ResourceCollection * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { return [ 'data' => UserResource::collection($this->collection), diff --git a/default-structure/app/Http/Resources/UserResource.php b/default-structure/app/Http/Resources/UserResource.php index b808b4d..76d0158 100644 --- a/default-structure/app/Http/Resources/UserResource.php +++ b/default-structure/app/Http/Resources/UserResource.php @@ -19,7 +19,7 @@ class UserResource extends JsonResource * @param \Illuminate\Http\Request $request * @return array */ - public function toArray($request) + public function toArray($request): array { if ($this->email_verified_at instanceof Carbon) { $this->email_verified_at = $this->email_verified_at->format('Y-m-d\TH:i:s'); diff --git a/default-structure/app/Http/ResponseTrait.php b/default-structure/app/Http/ResponseTrait.php index c48d648..192267f 100644 --- a/default-structure/app/Http/ResponseTrait.php +++ b/default-structure/app/Http/ResponseTrait.php @@ -11,15 +11,11 @@ trait ResponseTrait { /** * The current class of resource to respond - * - * @var string */ protected string $resourceItem; /** * The current class of collection resource to respond - * - * @var string */ protected string $resourceCollection; @@ -38,8 +34,6 @@ protected function getTimestampInMilliseconds(): int /** * Return no content for delete requests - * - * @return JsonResponse */ protected function respondWithNoContent(): JsonResponse { @@ -51,9 +45,6 @@ protected function respondWithNoContent(): JsonResponse /** * Return collection response from the application - * - * @param LengthAwarePaginator $collection - * @return mixed */ protected function respondWithCollection(LengthAwarePaginator $collection) { @@ -64,9 +55,6 @@ protected function respondWithCollection(LengthAwarePaginator $collection) /** * Return single item response from the application - * - * @param Model $item - * @return mixed */ protected function respondWithItem(Model $item) { diff --git a/default-structure/app/Models/Audit.php b/default-structure/app/Models/Audit.php index 55215f0..cbb4c11 100644 --- a/default-structure/app/Models/Audit.php +++ b/default-structure/app/Models/Audit.php @@ -8,21 +8,21 @@ /** * App\Models\Audit * - * @property string $id - * @property string|null $user_id - * @property string|null $user_type - * @property string $event - * @property string $auditable_id - * @property string $auditable_type - * @property array|null $old_values - * @property array|null $new_values - * @property string|null $url - * @property string|null $ip_address - * @property string|null $user_agent - * @property string|null $tags - * @property \Illuminate\Support\Carbon $created_at - * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $auditable - * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $user + * @property string $id + * @property string|null $user_id + * @property string|null $user_type + * @property string $event + * @property string $auditable_id + * @property string $auditable_type + * @property array|null $old_values + * @property array|null $new_values + * @property string|null $url + * @property string|null $ip_address + * @property string|null $user_agent + * @property string|null $tags + * @property \Illuminate\Support\Carbon $created_at + * @property-read Model|\Eloquent $auditable + * @property-read Model|\Eloquent $user * @method static Builder|Audit newModelQuery() * @method static Builder|Audit newQuery() * @method static Builder|Audit query() diff --git a/default-structure/app/Models/AuthorizedDevice.php b/default-structure/app/Models/AuthorizedDevice.php index 638003c..e861b33 100644 --- a/default-structure/app/Models/AuthorizedDevice.php +++ b/default-structure/app/Models/AuthorizedDevice.php @@ -13,26 +13,27 @@ /** * App\Models\AuthorizedDevice * - * @property string $id - * @property string $device - * @property string $platform - * @property string|null $platform_version - * @property string $browser - * @property string|null $browser_version - * @property string|null $city - * @property string|null $country_name - * @property string $authorization_token - * @property string|null $authorized_at - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property \Illuminate\Support\Carbon|null $deleted_at - * @property string $user_id + * @property string $id + * @property string $device + * @property string $platform + * @property string|null $platform_version + * @property string $browser + * @property string|null $browser_version + * @property string|null $city + * @property string|null $country_name + * @property string $authorization_token + * @property string|null $authorized_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property \Illuminate\Support\Carbon|null $deleted_at + * @property string $user_id * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \App\Models\User $user + * @property-read int|null $audits_count + * @property-read \App\Models\User $user + * @method static \Database\Factories\AuthorizedDeviceFactory factory(...$parameters) * @method static Builder|AuthorizedDevice newModelQuery() * @method static Builder|AuthorizedDevice newQuery() - * @method static Builder|AuthorizedDevice onlyTrashed() + * @method static \Illuminate\Database\Query\Builder|AuthorizedDevice onlyTrashed() * @method static Builder|AuthorizedDevice query() * @method static Builder|AuthorizedDevice whereAuthorizationToken($value) * @method static Builder|AuthorizedDevice whereAuthorizedAt($value) @@ -48,8 +49,8 @@ * @method static Builder|AuthorizedDevice wherePlatformVersion($value) * @method static Builder|AuthorizedDevice whereUpdatedAt($value) * @method static Builder|AuthorizedDevice whereUserId($value) - * @method static Builder|AuthorizedDevice withTrashed() - * @method static Builder|AuthorizedDevice withoutTrashed() + * @method static \Illuminate\Database\Query\Builder|AuthorizedDevice withTrashed() + * @method static \Illuminate\Database\Query\Builder|AuthorizedDevice withoutTrashed() * @mixin \Eloquent */ class AuthorizedDevice extends Model implements AuditableContract diff --git a/default-structure/app/Models/LoginHistory.php b/default-structure/app/Models/LoginHistory.php index 1d10d8f..8dd1ea7 100644 --- a/default-structure/app/Models/LoginHistory.php +++ b/default-structure/app/Models/LoginHistory.php @@ -10,26 +10,27 @@ /** * App\Models\LoginHistory * - * @property string $id - * @property string|null $device - * @property string|null $platform - * @property string|null $platform_version - * @property string|null $browser - * @property string|null $browser_version - * @property string|null $ip - * @property string|null $city - * @property string|null $region_code - * @property string|null $region_name - * @property string|null $country_code - * @property string|null $country_name - * @property string|null $continent_code - * @property string|null $continent_name - * @property string|null $latitude - * @property string|null $longitude - * @property string|null $zipcode + * @property string $id + * @property string|null $device + * @property string|null $platform + * @property string|null $platform_version + * @property string|null $browser + * @property string|null $browser_version + * @property string|null $ip + * @property string|null $city + * @property string|null $region_code + * @property string|null $region_name + * @property string|null $country_code + * @property string|null $country_name + * @property string|null $continent_code + * @property string|null $continent_name + * @property string|null $latitude + * @property string|null $longitude + * @property string|null $zipcode * @property \Illuminate\Support\Carbon $created_at - * @property string $user_id - * @property-read \App\Models\User $user + * @property string $user_id + * @property-read \App\Models\User $user + * @method static \Database\Factories\LoginHistoryFactory factory(...$parameters) * @method static Builder|LoginHistory newModelQuery() * @method static Builder|LoginHistory newQuery() * @method static Builder|LoginHistory query() diff --git a/default-structure/app/Models/Permission.php b/default-structure/app/Models/Permission.php index da42d7c..9fd9687 100644 --- a/default-structure/app/Models/Permission.php +++ b/default-structure/app/Models/Permission.php @@ -9,24 +9,24 @@ /** * App\Models\Permission * - * @property string $id - * @property string $name - * @property string $guard_name - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles - * @property-read int|null $roles_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users - * @property-read int|null $users_count + * @property string $id + * @property string $name + * @property string $guard_name + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits + * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection|Permission[] $permissions + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles + * @property-read int|null $roles_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users + * @property-read int|null $users_count * @method static Builder|Permission newModelQuery() * @method static Builder|Permission newQuery() - * @method static Builder|\Spatie\Permission\Models\Permission permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Permission permission($permissions) * @method static Builder|Permission query() - * @method static Builder|\Spatie\Permission\Models\Permission role($roles, $guard = null) + * @method static \Illuminate\Database\Eloquent\Builder|Permission role($roles, $guard = null) * @method static Builder|Permission whereCreatedAt($value) * @method static Builder|Permission whereGuardName($value) * @method static Builder|Permission whereId($value) diff --git a/default-structure/app/Models/Role.php b/default-structure/app/Models/Role.php index ecc9edf..f452efb 100644 --- a/default-structure/app/Models/Role.php +++ b/default-structure/app/Models/Role.php @@ -9,20 +9,20 @@ /** * App\Models\Role * - * @property string $id - * @property string $name - * @property string $guard_name - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits - * @property-read int|null $audits_count + * @property string $id + * @property string $name + * @property string $guard_name + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits + * @property-read int|null $audits_count * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users - * @property-read int|null $users_count + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\User[] $users + * @property-read int|null $users_count * @method static Builder|Role newModelQuery() * @method static Builder|Role newQuery() - * @method static Builder|\Spatie\Permission\Models\Role permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Role permission($permissions) * @method static Builder|Role query() * @method static Builder|Role whereCreatedAt($value) * @method static Builder|Role whereGuardName($value) diff --git a/default-structure/app/Models/User.php b/default-structure/app/Models/User.php index b7c4757..4fab0c7 100644 --- a/default-structure/app/Models/User.php +++ b/default-structure/app/Models/User.php @@ -8,6 +8,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Notifications\Notifiable; @@ -19,34 +20,39 @@ /** * App\Models\User * - * @property string $id - * @property string $name - * @property string $email - * @property string $password - * @property bool $is_active - * @property string|null $email_verified_at - * @property string $locale - * @property string|null $anti_phishing_code - * @property string|null $email_token_confirmation - * @property string|null $email_token_disable_account - * @property bool $google2fa_enable - * @property string|null $google2fa_secret - * @property string|null $google2fa_url - * @property string|null $remember_token - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AuthorizedDevice[] $authorizedDevices - * @property-read int|null $authorized_devices_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\LoginHistory[] $loginHistories - * @property-read int|null $login_histories_count - * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications - * @property-read int|null $notifications_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles - * @property-read int|null $roles_count + * @property string $id + * @property string $name + * @property string $email + * @property string $password + * @property bool $is_active + * @property string|null $email_verified_at + * @property string $locale + * @property string|null $anti_phishing_code + * @property string|null $email_token_confirmation + * @property string|null $email_token_disable_account + * @property bool $google2fa_enable + * @property string|null $google2fa_secret + * @property string|null $google2fa_url + * @property string|null $remember_token + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property string|null $two_factor_secret + * @property string|null $two_factor_recovery_codes + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Audit[] $audits + * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\AuthorizedDevice[] $authorizedDevices + * @property-read int|null $authorized_devices_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\LoginHistory[] $loginHistories + * @property-read int|null $login_histories_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|DatabaseNotification[] $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Permission[] $permissions + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Role[] $roles + * @property-read int|null $roles_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|DatabaseNotification[] $unreadNotifications + * @property-read int|null $unread_notifications_count + * @method static \Database\Factories\UserFactory factory(...$parameters) * @method static Builder|User newModelQuery() * @method static Builder|User newQuery() * @method static Builder|User permission($permissions) @@ -67,6 +73,8 @@ * @method static Builder|User whereName($value) * @method static Builder|User wherePassword($value) * @method static Builder|User whereRememberToken($value) + * @method static Builder|User whereTwoFactorRecoveryCodes($value) + * @method static Builder|User whereTwoFactorSecret($value) * @method static Builder|User whereUpdatedAt($value) * @mixin \Eloquent */ @@ -137,14 +145,14 @@ public function loginHistories(): HasMany return $this->hasMany(LoginHistory::class)->orderByDesc('created_at')->limit(10); } - public function authorizedDevices() + public function authorizedDevices(): HasMany { return $this->hasMany(AuthorizedDevice::class) ->whereNotNull('authorized_at') ->orderByDesc('created_at'); } - public function unreadNotifications() + public function unreadNotifications(): MorphMany { return $this->notifications()->whereNull('read_at'); } diff --git a/default-structure/app/Notifications/AccountDisabledNotification.php b/default-structure/app/Notifications/AccountDisabledNotification.php index a75ac89..53b70b6 100644 --- a/default-structure/app/Notifications/AccountDisabledNotification.php +++ b/default-structure/app/Notifications/AccountDisabledNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $supportLink = config('app.support_url'); diff --git a/default-structure/app/Notifications/AuthorizeDeviceNotification.php b/default-structure/app/Notifications/AuthorizeDeviceNotification.php index 87fae37..acc5c59 100644 --- a/default-structure/app/Notifications/AuthorizeDeviceNotification.php +++ b/default-structure/app/Notifications/AuthorizeDeviceNotification.php @@ -19,12 +19,12 @@ public function __construct(array $data) $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/default-structure/app/Notifications/PasswordChangedNotification.php b/default-structure/app/Notifications/PasswordChangedNotification.php index 6dba094..b76283c 100644 --- a/default-structure/app/Notifications/PasswordChangedNotification.php +++ b/default-structure/app/Notifications/PasswordChangedNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/default-structure/app/Notifications/ResetPasswordNotification.php b/default-structure/app/Notifications/ResetPasswordNotification.php index 0002679..cfd4a80 100644 --- a/default-structure/app/Notifications/ResetPasswordNotification.php +++ b/default-structure/app/Notifications/ResetPasswordNotification.php @@ -17,7 +17,7 @@ public function __construct(string $token) $this->onQueue('notifications'); } - public function via($notifiable) + public function via($notifiable): array { return ['mail']; } @@ -25,7 +25,7 @@ public function via($notifiable) /** * {@inheritdoc} */ - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code ?? null; $disableAccountToken = $notifiable->email_token_disable_account ?? null; diff --git a/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php b/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php index f2509ae..7830343 100644 --- a/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php +++ b/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php @@ -19,12 +19,12 @@ public function __construct(array $data) $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/default-structure/app/Notifications/TwoFactorAuthenticationWasDisabledNotification.php b/default-structure/app/Notifications/TwoFactorAuthenticationWasDisabledNotification.php index a8df705..5d45b6b 100644 --- a/default-structure/app/Notifications/TwoFactorAuthenticationWasDisabledNotification.php +++ b/default-structure/app/Notifications/TwoFactorAuthenticationWasDisabledNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/default-structure/app/Notifications/VerifyEmailNotification.php b/default-structure/app/Notifications/VerifyEmailNotification.php index ae05119..22f0bfe 100644 --- a/default-structure/app/Notifications/VerifyEmailNotification.php +++ b/default-structure/app/Notifications/VerifyEmailNotification.php @@ -19,12 +19,12 @@ public function __construct(string $token) $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage()) ->markdown('emails.default') diff --git a/default-structure/app/Policies/AuthorizedDevicePolicy.php b/default-structure/app/Policies/AuthorizedDevicePolicy.php index fd27c3a..d9f6973 100644 --- a/default-structure/app/Policies/AuthorizedDevicePolicy.php +++ b/default-structure/app/Policies/AuthorizedDevicePolicy.php @@ -12,78 +12,56 @@ class AuthorizedDevicePolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Models\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any authorized devices'); } /** * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @param \App\Models\AuthorizedDevice $model - * @return mixed */ - public function view(User $user, AuthorizedDevice $model) + public function view(User $user, AuthorizedDevice $model): bool { return $user->can('view authorized devices') || $user->id === $model->user_id; } /** * Determine whether the user can create models. - * - * @return mixed */ - public function create() + public function create(): bool { return false; } /** * Determine whether the user can update the model. - * - * @param \App\Models\User $user - * @param \App\Models\AuthorizedDevice $model - * @return mixed */ - public function update(User $user, AuthorizedDevice $model) + public function update(User $user, AuthorizedDevice $model): bool { return $user->can('update authorized devices') || $user->id === $model->user_id; } /** * Determine whether the user can delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete authorized devices'); } /** * Determine whether the user can restore the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore authorized devices'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete authorized devices'); } diff --git a/default-structure/app/Policies/LoginHistoryPolicy.php b/default-structure/app/Policies/LoginHistoryPolicy.php index 3f6883a..61a585a 100644 --- a/default-structure/app/Policies/LoginHistoryPolicy.php +++ b/default-structure/app/Policies/LoginHistoryPolicy.php @@ -12,73 +12,56 @@ class LoginHistoryPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Models\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any login histories'); } /** * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @param \App\Models\LoginHistory $model - * @return mixed */ - public function view(User $user, LoginHistory $model) + public function view(User $user, LoginHistory $model): bool { return $user->can('view login histories') || $user->id === $model->user_id; } /** * Determine whether the user can create models. - * - * @return mixed */ - public function create() + public function create(): bool { return false; } /** * Determine whether the user can update the model. - * - * @return mixed */ - public function update() + public function update(): bool { return false; } /** * Determine whether the user can delete the model. - * - * @return mixed */ - public function delete() + public function delete(): bool { return false; } /** * Determine whether the user can restore the model. - * - * @return mixed */ - public function restore() + public function restore(): bool { return false; } /** * Determine whether the user can permanently delete the model. - * - * @return mixed */ - public function forceDelete() + public function forceDelete(): bool { return false; } diff --git a/default-structure/app/Policies/PermissionPolicy.php b/default-structure/app/Policies/PermissionPolicy.php index 7a7f1a3..7d2eaf6 100644 --- a/default-structure/app/Policies/PermissionPolicy.php +++ b/default-structure/app/Policies/PermissionPolicy.php @@ -11,77 +11,56 @@ class PermissionPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Models\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any permissions'); } /** * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function view(User $user) + public function view(User $user): bool { return $user->can('view permissions'); } /** * Determine whether the user can create models. - * - * @param \App\Models\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create permissions'); } /** * Determine whether the user can update the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function update(User $user) + public function update(User $user): bool { return $user->can('update permissions'); } /** * Determine whether the user can delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete permissions'); } /** * Determine whether the user can restore the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore permissions'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete permissions'); } diff --git a/default-structure/app/Policies/RolePolicy.php b/default-structure/app/Policies/RolePolicy.php index 5e9a28b..43038b4 100644 --- a/default-structure/app/Policies/RolePolicy.php +++ b/default-structure/app/Policies/RolePolicy.php @@ -11,77 +11,56 @@ class RolePolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Models\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any permissions'); } /** * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function view(User $user) + public function view(User $user): bool { return $user->can('view roles'); } /** * Determine whether the user can create models. - * - * @param \App\Models\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create roles'); } /** * Determine whether the user can update the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function update(User $user) + public function update(User $user): bool { return $user->can('update roles'); } /** * Determine whether the user can delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete roles'); } /** * Determine whether the user can restore the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore roles'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete roles'); } diff --git a/default-structure/app/Policies/UserPolicy.php b/default-structure/app/Policies/UserPolicy.php index e50626c..3af2af3 100644 --- a/default-structure/app/Policies/UserPolicy.php +++ b/default-structure/app/Policies/UserPolicy.php @@ -11,79 +11,56 @@ class UserPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Models\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any users'); } /** * Determine whether the user can view the model. - * - * @param \App\Models\User $user - * @param \App\Models\User $model - * @return mixed */ - public function view(User $user, User $model) + public function view(User $user, User $model): bool { return $user->can('view users') || $user->id === $model->id; } /** * Determine whether the user can create models. - * - * @param \App\Models\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create users'); } /** * Determine whether the user can update the model. - * - * @param \App\Models\User $user - * @param \App\Models\User $model - * @return mixed */ - public function update(User $user, User $model) + public function update(User $user, User $model): bool { return $user->can('update users') || $user->id === $model->id; } /** * Determine whether the user can delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete users'); } /** * Determine whether the user can restore the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore users'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Models\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete users'); } diff --git a/default-structure/app/Providers/AuthServiceProvider.php b/default-structure/app/Providers/AuthServiceProvider.php index 2b196a0..4c659de 100644 --- a/default-structure/app/Providers/AuthServiceProvider.php +++ b/default-structure/app/Providers/AuthServiceProvider.php @@ -30,7 +30,7 @@ public function boot() $this->registerPolicies(); ResetPassword::createUrlUsing(function ($user, string $token) { - return env('SPA_URL') . '/reset-password?token=' . $token; + return config('spa_url') . '/reset-password?token=' . $token; }); } } diff --git a/default-structure/app/Providers/RepositoryServiceProvider.php b/default-structure/app/Providers/RepositoryServiceProvider.php index cd426f9..9185966 100644 --- a/default-structure/app/Providers/RepositoryServiceProvider.php +++ b/default-structure/app/Providers/RepositoryServiceProvider.php @@ -17,10 +17,8 @@ class RepositoryServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. - * - * @var bool */ - protected $defer = true; + protected bool $defer = true; /** * Register the application services. diff --git a/default-structure/app/Repositories/EloquentAuthorizedDevicesRepository.php b/default-structure/app/Repositories/EloquentAuthorizedDevicesRepository.php index c24db81..ea6aa92 100644 --- a/default-structure/app/Repositories/EloquentAuthorizedDevicesRepository.php +++ b/default-structure/app/Repositories/EloquentAuthorizedDevicesRepository.php @@ -3,6 +3,8 @@ namespace App\Repositories; use App\Contracts\AuthorizedDeviceRepository; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; class EloquentAuthorizedDevicesRepository extends EloquentRepository implements AuthorizedDeviceRepository { @@ -11,7 +13,7 @@ public function doesNotHaveAuthorizedAnyDeviceYet(string $userId): bool return $this->model::query()->where('user_id', '=', $userId)->count('id') === 0; } - public function findDeviceByCriteria(array $data) + public function findDeviceByCriteria(array $data): Model|Builder|null { return $this->model::query() ->where('user_id', '=', $data['user_id']) diff --git a/default-structure/app/Services/AuthorizedDeviceService.php b/default-structure/app/Services/AuthorizedDeviceService.php index 87132fa..1772a9b 100644 --- a/default-structure/app/Services/AuthorizedDeviceService.php +++ b/default-structure/app/Services/AuthorizedDeviceService.php @@ -17,7 +17,7 @@ public function __construct(AuthorizedDeviceRepository $authorizedDeviceReposito $this->authorizedDeviceRepository = $authorizedDeviceRepository; } - public function store(User $user, array $data) + public function store(User $user, array $data): bool|array { $device = $this->authorizedDeviceRepository->findDeviceByCriteria($data); @@ -50,7 +50,7 @@ public function store(User $user, array $data) return $this->storeAndAskAuthorizationForNewDevice($user, $data); } - private function storeAndAskAuthorizationForNewDevice(User $user, array $data) + private function storeAndAskAuthorizationForNewDevice(User $user, array $data): array { $device = $this->authorizedDeviceRepository->store([ 'device' => $data['device'], diff --git a/default-structure/app/Services/DisableAccountService.php b/default-structure/app/Services/DisableAccountService.php index 6049b2b..a9f6fa5 100644 --- a/default-structure/app/Services/DisableAccountService.php +++ b/default-structure/app/Services/DisableAccountService.php @@ -47,7 +47,7 @@ private function loggoutUserIfNecessary() if (auth()->check()) { (new TwoFactorAuthenticator(request()))->logout(); Cache::forget(auth()->id()); - Cache::tags('users:' . auth()->id()); + Cache::tags('users:' . auth()->id())->flush(); auth()->logout(); } } diff --git a/default-structure/config/app.php b/default-structure/config/app.php index 57c7557..b82a4ed 100644 --- a/default-structure/config/app.php +++ b/default-structure/config/app.php @@ -53,6 +53,7 @@ */ 'url' => env('APP_URL', 'http://localhost'), + 'spa_url' => env('SPA_URL', 'http://localhost:3000'), 'asset_url' => env('ASSET_URL', null), From 2432af5b9073e915606c43eaff88a21349bea562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sat, 17 Apr 2021 22:15:39 -0300 Subject: [PATCH 4/8] refactor: modular structure to php 8, laravel 8 --- .../Http/Controllers/Auth/LoginController.php | 4 +- .../app/Providers/RouteServiceProvider.php | 4 +- .../database/seeders/DatabaseSeeder.php | 2 + .../seeders/PermissionsTableSeeder.php | 2 + .../database/seeders/RolesTableSeeder.php | 2 + .../database/seeders/UsersTableSeed.php | 8 +- default-structure/public/index.php | 4 + modular-structure/.env.example | 6 +- modular-structure/.env.testing | 6 +- modular-structure/Dockerfile | 4 +- modular-structure/Dockerfile.testing | 2 +- .../app/Application/Http/Kernel.php | 2 +- .../Http/Middlewares/TrustProxies.php | 2 +- .../app/Domain/Audits/Entities/Audit.php | 32 +- .../Factories/AuthorizedDeviceFactory.php | 16 +- .../Factories/LoginHistoryFactory.php | 14 +- .../Users/Database/Factories/UserFactory.php | 61 +- .../Users/Database/Seeds/UsersTableSeed.php | 6 +- .../Users/Entities/AuthorizedDevice.php | 42 +- .../Domain/Users/Entities/LoginHistory.php | 49 +- .../app/Domain/Users/Entities/Permission.php | 32 +- .../app/Domain/Users/Entities/Role.php | 24 +- .../app/Domain/Users/Entities/User.php | 76 +- .../Http/Controllers/LoginController.php | 22 +- .../Users/Providers/RouteServiceProvider.php | 34 +- .../Feature/AuthorizeDeviceControllerTest.php | 16 +- .../Feature/DisableAccountControllerTest.php | 6 +- .../Tests/Feature/LoginControllerTest.php | 6 +- .../Feature/NotificationControllerTest.php | 2 +- .../Feature/PasswordResetListenerTest.php | 2 +- .../Tests/Feature/RegisterControllerTest.php | 6 +- .../Feature/ResetPasswordControllerTest.php | 2 +- .../TwoFactorAuthenticationControllerTest.php | 2 +- ...rAuthenticationWasDisabledListenerTest.php | 2 +- .../Tests/Feature/UserControllerTest.php | 16 +- .../Feature/UserRegisteredListenerTest.php | 2 +- .../Users/Tests/Unit/AuthorizedDeviceTest.php | 4 +- .../Tests/Unit/CurrentPasswordRuleTest.php | 2 +- .../Users/Tests/Unit/LoginHistoryTest.php | 4 +- .../Users/Tests/Unit/NotificationsTest.php | 2 +- .../Users/Tests/Unit/UserRepositoryTest.php | 2 +- .../app/Domain/Users/Tests/Unit/UserTest.php | 6 +- .../Infrastructure/Abstracts/ModelFactory.php | 45 - .../Abstracts/ServiceProvider.php | 13 - modular-structure/composer.json | 33 +- modular-structure/composer.lock | 1771 ++++++++++------- modular-structure/config/app.php | 78 +- modular-structure/config/audit.php | 5 +- modular-structure/config/auth.php | 4 +- modular-structure/config/broadcasting.php | 36 +- modular-structure/config/cache.php | 41 +- modular-structure/config/cors.php | 45 + modular-structure/config/database.php | 92 +- modular-structure/config/filesystems.php | 55 +- modular-structure/config/geoip.php | 173 ++ modular-structure/config/horizon.php | 81 +- modular-structure/config/insights.php | 9 - modular-structure/config/logging.php | 13 +- modular-structure/config/permission.php | 9 +- modular-structure/config/queue.php | 11 +- modular-structure/config/services.php | 6 +- modular-structure/config/session.php | 12 +- ...8_010240_add_uuid_to_failed_jobs_table.php | 32 + .../{seeds => seeders}/DatabaseSeeder.php | 4 +- modular-structure/docker-compose.develop.yml | 6 +- modular-structure/docker-compose.testing.yml | 12 +- modular-structure/php.ini | 4 +- modular-structure/php.testing.ini | 5 +- modular-structure/public/index.php | 4 + 69 files changed, 1875 insertions(+), 1262 deletions(-) delete mode 100644 modular-structure/app/Infrastructure/Abstracts/ModelFactory.php create mode 100644 modular-structure/config/cors.php create mode 100644 modular-structure/config/geoip.php create mode 100644 modular-structure/database/migrations/2021_04_18_010240_add_uuid_to_failed_jobs_table.php rename modular-structure/database/{seeds => seeders}/DatabaseSeeder.php (82%) diff --git a/default-structure/app/Http/Controllers/Auth/LoginController.php b/default-structure/app/Http/Controllers/Auth/LoginController.php index 0bfbd27..0931d61 100644 --- a/default-structure/app/Http/Controllers/Auth/LoginController.php +++ b/default-structure/app/Http/Controllers/Auth/LoginController.php @@ -56,7 +56,7 @@ protected function attemptLogin(Request $request) */ protected function sendLoginResponse(Request $request) { - $user = auth()->user(); + $user = $request->user(); try { $this->checkUserIfIsActive($user, $request); @@ -115,7 +115,7 @@ public function logout(Request $request) Cache::forget($id); Cache::tags('users:' . $id)->flush(); - $this->guard()->logout(true); + $this->guard()->logout(); } private function checkIfUserHasVerifiedEmail(User $user, Request $request) diff --git a/default-structure/app/Providers/RouteServiceProvider.php b/default-structure/app/Providers/RouteServiceProvider.php index b4edf1e..21b0949 100644 --- a/default-structure/app/Providers/RouteServiceProvider.php +++ b/default-structure/app/Providers/RouteServiceProvider.php @@ -37,10 +37,8 @@ public function boot() /** * Configure the rate limiters for the application. - * - * @return void */ - protected function configureRateLimiting() + protected function configureRateLimiting(): void { RateLimiter::for('api', function (Request $request) { return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); diff --git a/default-structure/database/seeders/DatabaseSeeder.php b/default-structure/database/seeders/DatabaseSeeder.php index 26904c6..a521171 100644 --- a/default-structure/database/seeders/DatabaseSeeder.php +++ b/default-structure/database/seeders/DatabaseSeeder.php @@ -1,5 +1,7 @@ create([ + $user = User::factory()->create([ 'email' => 'test@test.com', 'email_verified_at' => now(), ]); $user->assignRole(Role::ADMIN); - factory(LoginHistory::class)->create(['user_id' => $user]); - factory(AuthorizedDevice::class)->create(['user_id' => $user]); + LoginHistory::factory()->create(['user_id' => $user]); + AuthorizedDevice::factory()->create(['user_id' => $user]); } } diff --git a/default-structure/public/index.php b/default-structure/public/index.php index f9ea692..02d9057 100644 --- a/default-structure/public/index.php +++ b/default-structure/public/index.php @@ -9,6 +9,10 @@ define('LARAVEL_START', microtime(true)); +if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { + require __DIR__.'/../storage/framework/maintenance.php'; +} + /* |-------------------------------------------------------------------------- | Register The Auto Loader diff --git a/modular-structure/.env.example b/modular-structure/.env.example index 3a00e22..bf03b6d 100644 --- a/modular-structure/.env.example +++ b/modular-structure/.env.example @@ -9,9 +9,9 @@ LOG_CHANNEL=stack DB_CONNECTION=pgsql DB_HOST=pgsql DB_PORT=5432 -DB_DATABASE=default -DB_USERNAME=default -DB_PASSWORD=default +DB_DATABASE=modular +DB_USERNAME=modular +DB_PASSWORD=modular BROADCAST_DRIVER=pusher CACHE_DRIVER=redis diff --git a/modular-structure/.env.testing b/modular-structure/.env.testing index a92b7ee..775f21e 100644 --- a/modular-structure/.env.testing +++ b/modular-structure/.env.testing @@ -9,9 +9,9 @@ LOG_CHANNEL=stack DB_CONNECTION=pgsql DB_HOST=pgsql DB_PORT=5432 -DB_DATABASE=default_testing -DB_USERNAME=default_testing -DB_PASSWORD=default_testing +DB_DATABASE=modular_testing +DB_USERNAME=modular_testing +DB_PASSWORD=modular_testing BROADCAST_DRIVER=pusher CACHE_DRIVER=redis diff --git a/modular-structure/Dockerfile b/modular-structure/Dockerfile index 05450c1..cf0b68e 100644 --- a/modular-structure/Dockerfile +++ b/modular-structure/Dockerfile @@ -12,8 +12,8 @@ RUN composer install $COMPOSER_FLAGS \ && chown -R 0:www-data /var/www \ && find /var/www -type f -exec chmod 664 {} \; \ && find /var/www -type d -exec chmod 775 {} \; \ - && chgrp -R www-data public/cache-html storage bootstrap/cache \ - && chmod -R ug+rwx public/cache-html storage bootstrap/cache + && chgrp -R www-data storage bootstrap/cache \ + && chmod -R ug+rwx storage bootstrap/cache CMD ["/usr/local/sbin/php-fpm"] diff --git a/modular-structure/Dockerfile.testing b/modular-structure/Dockerfile.testing index 13e02e2..de2a8e2 100644 --- a/modular-structure/Dockerfile.testing +++ b/modular-structure/Dockerfile.testing @@ -1,4 +1,4 @@ -FROM ibrunotome/php:7.4-fpm +FROM ibrunotome/php:8.0-fpm ARG COMPOSER_FLAGS diff --git a/modular-structure/app/Application/Http/Kernel.php b/modular-structure/app/Application/Http/Kernel.php index 359bfae..70cdb62 100644 --- a/modular-structure/app/Application/Http/Kernel.php +++ b/modular-structure/app/Application/Http/Kernel.php @@ -48,7 +48,7 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'api' => [ - 'throttle:60,1', + 'throttle:api', SubstituteBindings::class, ], ]; diff --git a/modular-structure/app/Application/Http/Middlewares/TrustProxies.php b/modular-structure/app/Application/Http/Middlewares/TrustProxies.php index af32197..22b56df 100644 --- a/modular-structure/app/Application/Http/Middlewares/TrustProxies.php +++ b/modular-structure/app/Application/Http/Middlewares/TrustProxies.php @@ -19,5 +19,5 @@ class TrustProxies extends Middleware * * @var array */ - protected $headers = Request::HEADER_X_FORWARDED_ALL; + protected $headers = Request::HEADER_X_FORWARDED_FOR | Request::HEADER_X_FORWARDED_HOST | Request::HEADER_X_FORWARDED_PORT | Request::HEADER_X_FORWARDED_PROTO | Request::HEADER_X_FORWARDED_AWS_ELB; } diff --git a/modular-structure/app/Domain/Audits/Entities/Audit.php b/modular-structure/app/Domain/Audits/Entities/Audit.php index 224f2da..677037b 100644 --- a/modular-structure/app/Domain/Audits/Entities/Audit.php +++ b/modular-structure/app/Domain/Audits/Entities/Audit.php @@ -6,23 +6,23 @@ use Illuminate\Database\Eloquent\Model; /** - * Class Audit + * App\Domain\Audits\Entities\Audit * - * @property string $id - * @property string|null $user_id - * @property string|null $user_type - * @property string $event - * @property string $auditable_id - * @property string $auditable_type - * @property array|null $old_values - * @property array|null $new_values - * @property string|null $url - * @property string|null $ip_address - * @property string|null $user_agent - * @property string|null $tags - * @property \Illuminate\Support\Carbon $created_at - * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $auditable - * @property-read \Illuminate\Database\Eloquent\Model|\Eloquent $user + * @property string $id + * @property string|null $user_id + * @property string|null $user_type + * @property string $event + * @property string $auditable_id + * @property string $auditable_type + * @property array|null $old_values + * @property array|null $new_values + * @property string|null $url + * @property string|null $ip_address + * @property string|null $user_agent + * @property string|null $tags + * @property \Illuminate\Support\Carbon $created_at + * @property-read Model|\Eloquent $auditable + * @property-read Model|\Eloquent $user * @method static Builder|Audit newModelQuery() * @method static Builder|Audit newQuery() * @method static Builder|Audit query() diff --git a/modular-structure/app/Domain/Users/Database/Factories/AuthorizedDeviceFactory.php b/modular-structure/app/Domain/Users/Database/Factories/AuthorizedDeviceFactory.php index 53b70c7..bfcdaa4 100644 --- a/modular-structure/app/Domain/Users/Database/Factories/AuthorizedDeviceFactory.php +++ b/modular-structure/app/Domain/Users/Database/Factories/AuthorizedDeviceFactory.php @@ -3,18 +3,18 @@ namespace App\Domain\Users\Database\Factories; use App\Domain\Users\Entities\AuthorizedDevice; -use App\Infrastructure\Abstracts\ModelFactory; +use Illuminate\Database\Eloquent\Factories\Factory; use Ramsey\Uuid\Uuid; -class AuthorizedDeviceFactory extends ModelFactory +class AuthorizedDeviceFactory extends Factory { - protected string $model = AuthorizedDevice::class; + protected $model = AuthorizedDevice::class; - public function fields() + public function definition(): array { return [ - 'id' => Uuid::uuid4(), - 'authorization_token' => Uuid::uuid4(), + 'id' => Uuid::uuid4()->toString(), + 'authorization_token' => Uuid::uuid4()->toString(), 'device' => $this->faker->phoneNumber, 'platform' => $this->faker->phoneNumber, 'browser' => $this->faker->randomElement([ @@ -25,8 +25,4 @@ public function fields() ]), ]; } - - public function states() - { - } } diff --git a/modular-structure/app/Domain/Users/Database/Factories/LoginHistoryFactory.php b/modular-structure/app/Domain/Users/Database/Factories/LoginHistoryFactory.php index 66bc74e..0340157 100644 --- a/modular-structure/app/Domain/Users/Database/Factories/LoginHistoryFactory.php +++ b/modular-structure/app/Domain/Users/Database/Factories/LoginHistoryFactory.php @@ -3,21 +3,17 @@ namespace App\Domain\Users\Database\Factories; use App\Domain\Users\Entities\LoginHistory; -use App\Infrastructure\Abstracts\ModelFactory; +use Illuminate\Database\Eloquent\Factories\Factory; use Ramsey\Uuid\Uuid; -class LoginHistoryFactory extends ModelFactory +class LoginHistoryFactory extends Factory { - protected string $model = LoginHistory::class; + protected $model = LoginHistory::class; - public function fields() + public function definition(): array { return [ - 'id' => Uuid::uuid4(), + 'id' => Uuid::uuid4()->toString(), ]; } - - public function states() - { - } } diff --git a/modular-structure/app/Domain/Users/Database/Factories/UserFactory.php b/modular-structure/app/Domain/Users/Database/Factories/UserFactory.php index ea377d8..675800f 100644 --- a/modular-structure/app/Domain/Users/Database/Factories/UserFactory.php +++ b/modular-structure/app/Domain/Users/Database/Factories/UserFactory.php @@ -3,53 +3,46 @@ namespace App\Domain\Users\Database\Factories; use App\Domain\Users\Entities\User; -use App\Infrastructure\Abstracts\ModelFactory; +use Illuminate\Database\Eloquent\Factories\Factory; use Ramsey\Uuid\Uuid; -class UserFactory extends ModelFactory +class UserFactory extends Factory { - protected string $model = User::class; + protected $model = User::class; - public function fields() + public function definition(): array { return [ - 'id' => Uuid::uuid4()->toString(), - 'email' => strtolower(str_replace('-', '', Uuid::uuid4()->toString())) . '@gmail.com', - 'password' => bcrypt('secretxxx'), - 'is_active' => true, - 'email_verified_at' => now(), - 'locale' => 'en_US', + 'id' => Uuid::uuid4(), 'name' => $this->faker->name, 'anti_phishing_code' => $this->faker->word, 'email_token_confirmation' => Uuid::uuid4(), 'email_token_disable_account' => Uuid::uuid4(), + 'email' => $this->faker->unique()->email, + 'password' => bcrypt('secretxxx'), + 'is_active' => 1, + 'email_verified_at' => now(), + 'locale' => 'en_US', ]; } - public function states() + public function active(): UserFactory + { + return $this->state(fn() => ['is_active' => true]); + } + + public function inactive(): UserFactory + { + return $this->state(fn() => ['is_active' => false]); + } + + public function emailVerified(): UserFactory + { + return $this->state(fn() => ['email_verified_at' => now()->format('Y-m-d H:i:s')]); + } + + public function emailUnverified(): UserFactory { - $this->factory->state($this->model, 'active', function () { - return [ - 'is_active' => true, - ]; - }); - - $this->factory->state($this->model, 'inactive', function () { - return [ - 'is_active' => false, - ]; - }); - - $this->factory->state($this->model, 'email_verified', function () { - return [ - 'email_verified_at' => now()->format('Y-m-d H:i:s'), - ]; - }); - - $this->factory->state($this->model, 'email_unverified', function () { - return [ - 'email_verified_at' => null, - ]; - }); + return $this->state(fn() => ['email_verified_at' => null]); } } diff --git a/modular-structure/app/Domain/Users/Database/Seeds/UsersTableSeed.php b/modular-structure/app/Domain/Users/Database/Seeds/UsersTableSeed.php index 71e172c..7e00512 100644 --- a/modular-structure/app/Domain/Users/Database/Seeds/UsersTableSeed.php +++ b/modular-structure/app/Domain/Users/Database/Seeds/UsersTableSeed.php @@ -17,14 +17,14 @@ class UsersTableSeed extends Seeder */ public function run() { - $user = factory(User::class)->create([ + $user = User::factory()->create([ 'email' => 'test@test.com', 'email_verified_at' => now(), ]); $user->assignRole(Role::ADMIN); - factory(LoginHistory::class)->create(['user_id' => $user]); - factory(AuthorizedDevice::class)->create(['user_id' => $user]); + LoginHistory::factory()->create(['user_id' => $user]); + AuthorizedDevice::factory()->create(['user_id' => $user]); } } diff --git a/modular-structure/app/Domain/Users/Entities/AuthorizedDevice.php b/modular-structure/app/Domain/Users/Entities/AuthorizedDevice.php index 8802a52..448fff6 100644 --- a/modular-structure/app/Domain/Users/Entities/AuthorizedDevice.php +++ b/modular-structure/app/Domain/Users/Entities/AuthorizedDevice.php @@ -2,6 +2,8 @@ namespace App\Domain\Users\Entities; +use App\Domain\Users\Database\Factories\AuthorizedDeviceFactory; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Query\Builder; @@ -9,25 +11,25 @@ use OwenIt\Auditing\Contracts\Auditable as AuditableContract; /** - * Class AuthorizedDevice + * App\Domain\Users\Entities\AuthorizedDevice * - * @property string $id - * @property string $device - * @property string $platform - * @property string|null $platform_version - * @property string $browser - * @property string|null $browser_version - * @property string|null $city - * @property string|null $country_name - * @property string $authorization_token - * @property string|null $authorized_at - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property \Illuminate\Support\Carbon|null $deleted_at - * @property string $user_id + * @property string $id + * @property string $device + * @property string $platform + * @property string|null $platform_version + * @property string $browser + * @property string|null $browser_version + * @property string|null $city + * @property string|null $country_name + * @property string $authorization_token + * @property string|null $authorized_at + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property \Illuminate\Support\Carbon|null $deleted_at + * @property string $user_id * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \App\Domain\Users\Entities\User $user + * @property-read int|null $audits_count + * @property-read \App\Domain\Users\Entities\User $user * @method static \Illuminate\Database\Eloquent\Builder|AuthorizedDevice newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|AuthorizedDevice newQuery() * @method static Builder|AuthorizedDevice onlyTrashed() @@ -53,6 +55,7 @@ class AuthorizedDevice extends Model implements AuditableContract { use Auditable; + use HasFactory; use SoftDeletes; protected static $unguarded = true; @@ -67,6 +70,11 @@ class AuthorizedDevice extends Model implements AuditableContract 'id' => 'string', ]; + protected static function newFactory() + { + return AuthorizedDeviceFactory::new(); + } + ################ # Relationships ################ diff --git a/modular-structure/app/Domain/Users/Entities/LoginHistory.php b/modular-structure/app/Domain/Users/Entities/LoginHistory.php index e7395ac..b5552a8 100644 --- a/modular-structure/app/Domain/Users/Entities/LoginHistory.php +++ b/modular-structure/app/Domain/Users/Entities/LoginHistory.php @@ -2,31 +2,33 @@ namespace App\Domain\Users\Entities; +use App\Domain\Users\Database\Factories\LoginHistoryFactory; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; /** - * Class LoginHistory + * App\Domain\Users\Entities\LoginHistory * - * @property string $id - * @property string|null $device - * @property string|null $platform - * @property string|null $platform_version - * @property string|null $browser - * @property string|null $browser_version - * @property string|null $ip - * @property string|null $city - * @property string|null $region_code - * @property string|null $region_name - * @property string|null $country_code - * @property string|null $country_name - * @property string|null $continent_code - * @property string|null $continent_name - * @property string|null $latitude - * @property string|null $longitude - * @property string|null $zipcode - * @property \Illuminate\Support\Carbon $created_at - * @property string $user_id + * @property string $id + * @property string|null $device + * @property string|null $platform + * @property string|null $platform_version + * @property string|null $browser + * @property string|null $browser_version + * @property string|null $ip + * @property string|null $city + * @property string|null $region_code + * @property string|null $region_name + * @property string|null $country_code + * @property string|null $country_name + * @property string|null $continent_code + * @property string|null $continent_name + * @property string|null $latitude + * @property string|null $longitude + * @property string|null $zipcode + * @property \Illuminate\Support\Carbon $created_at + * @property string $user_id * @property-read \App\Domain\Users\Entities\User $user * @method static Builder|LoginHistory newModelQuery() * @method static Builder|LoginHistory newQuery() @@ -54,6 +56,8 @@ */ class LoginHistory extends Model { + use HasFactory; + public const UPDATED_AT = null; protected static $unguarded = true; @@ -62,6 +66,11 @@ class LoginHistory extends Model protected $keyType = 'string'; + protected static function newFactory() + { + return LoginHistoryFactory::new(); + } + ################ # Relationships ################ diff --git a/modular-structure/app/Domain/Users/Entities/Permission.php b/modular-structure/app/Domain/Users/Entities/Permission.php index 0e793ae..b9a8856 100644 --- a/modular-structure/app/Domain/Users/Entities/Permission.php +++ b/modular-structure/app/Domain/Users/Entities/Permission.php @@ -7,26 +7,26 @@ use OwenIt\Auditing\Contracts\Auditable as AuditableContract; /** - * Class Permission + * App\Domain\Users\Entities\Permission * - * @property string $id - * @property string $name - * @property string $guard_name - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Role[] $roles - * @property-read int|null $roles_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\User[] $users - * @property-read int|null $users_count + * @property string $id + * @property string $name + * @property string $guard_name + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits + * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection|Permission[] $permissions + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Role[] $roles + * @property-read int|null $roles_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\User[] $users + * @property-read int|null $users_count * @method static Builder|Permission newModelQuery() * @method static Builder|Permission newQuery() - * @method static Builder|\Spatie\Permission\Models\Permission permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Permission permission($permissions) * @method static Builder|Permission query() - * @method static Builder|\Spatie\Permission\Models\Permission role($roles, $guard = null) + * @method static \Illuminate\Database\Eloquent\Builder|Permission role($roles, $guard = null) * @method static Builder|Permission whereCreatedAt($value) * @method static Builder|Permission whereGuardName($value) * @method static Builder|Permission whereId($value) diff --git a/modular-structure/app/Domain/Users/Entities/Role.php b/modular-structure/app/Domain/Users/Entities/Role.php index 371ff67..a95372f 100644 --- a/modular-structure/app/Domain/Users/Entities/Role.php +++ b/modular-structure/app/Domain/Users/Entities/Role.php @@ -7,22 +7,22 @@ use OwenIt\Auditing\Contracts\Auditable as AuditableContract; /** - * Class Role + * App\Domain\Users\Entities\Role * - * @property string $id - * @property string $name - * @property string $guard_name - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits - * @property-read int|null $audits_count + * @property string $id + * @property string $name + * @property string $guard_name + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits + * @property-read int|null $audits_count * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\User[] $users - * @property-read int|null $users_count + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\User[] $users + * @property-read int|null $users_count * @method static Builder|Role newModelQuery() * @method static Builder|Role newQuery() - * @method static Builder|\Spatie\Permission\Models\Role permission($permissions) + * @method static \Illuminate\Database\Eloquent\Builder|Role permission($permissions) * @method static Builder|Role query() * @method static Builder|Role whereCreatedAt($value) * @method static Builder|Role whereGuardName($value) diff --git a/modular-structure/app/Domain/Users/Entities/User.php b/modular-structure/app/Domain/Users/Entities/User.php index 0eaebef..736244c 100644 --- a/modular-structure/app/Domain/Users/Entities/User.php +++ b/modular-structure/app/Domain/Users/Entities/User.php @@ -2,10 +2,14 @@ namespace App\Domain\Users\Entities; +use App\Domain\Users\Database\Factories\UserFactory; use App\Domain\Users\Notifications\ResetPasswordNotification; use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Contracts\Translation\HasLocalePreference; use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\DatabaseNotification; use Illuminate\Notifications\Notifiable; @@ -15,36 +19,38 @@ use Tymon\JWTAuth\Contracts\JWTSubject; /** - * Class User + * App\Domain\Users\Entities\User * - * @property string $id - * @property string $name - * @property string $email - * @property string $password - * @property bool $is_active - * @property string|null $email_verified_at - * @property string $locale - * @property string|null $anti_phishing_code - * @property string|null $email_token_confirmation - * @property string|null $email_token_disable_account - * @property bool $google2fa_enable - * @property string|null $google2fa_secret - * @property string|null $google2fa_url - * @property string|null $remember_token - * @property \Illuminate\Support\Carbon|null $created_at - * @property \Illuminate\Support\Carbon|null $updated_at - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits - * @property-read int|null $audits_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\AuthorizedDevice[] $authorizedDevices - * @property-read int|null $authorized_devices_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\LoginHistory[] $loginHistories - * @property-read int|null $login_histories_count - * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|\Illuminate\Notifications\DatabaseNotification[] $notifications - * @property-read int|null $notifications_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Permission[] $permissions - * @property-read int|null $permissions_count - * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Role[] $roles - * @property-read int|null $roles_count + * @property string $id + * @property string $email + * @property string $password + * @property bool $is_active + * @property string|null $email_verified_at + * @property string $locale + * @property string $name + * @property string|null $anti_phishing_code + * @property string|null $email_token_confirmation + * @property string|null $email_token_disable_account + * @property bool $google2fa_enable + * @property string|null $google2fa_secret + * @property string|null $google2fa_url + * @property string|null $remember_token + * @property \Illuminate\Support\Carbon|null $created_at + * @property \Illuminate\Support\Carbon|null $updated_at + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Audits\Entities\Audit[] $audits + * @property-read int|null $audits_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\AuthorizedDevice[] $authorizedDevices + * @property-read int|null $authorized_devices_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\LoginHistory[] $loginHistories + * @property-read int|null $login_histories_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|DatabaseNotification[] $notifications + * @property-read int|null $notifications_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Permission[] $permissions + * @property-read int|null $permissions_count + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Domain\Users\Entities\Role[] $roles + * @property-read int|null $roles_count + * @property-read \Illuminate\Notifications\DatabaseNotificationCollection|DatabaseNotification[] $unreadNotifications + * @property-read int|null $unread_notifications_count * @method static Builder|User newModelQuery() * @method static Builder|User newQuery() * @method static Builder|User permission($permissions) @@ -72,6 +78,7 @@ class User extends Authenticatable implements JWTSubject, AuditableContract, Has { use Auditable; use HasRoles; + use HasFactory; use Notifiable; public $incrementing = false; @@ -99,6 +106,11 @@ class User extends Authenticatable implements JWTSubject, AuditableContract, Has 'remember_token', ]; + protected static function newFactory() + { + return UserFactory::new(); + } + /** * {@inheritdoc} */ @@ -133,19 +145,19 @@ public function loginHistories() return $this->hasMany(LoginHistory::class)->orderBy('created_at', 'desc')->limit(10); } - public function authorizedDevices() + public function authorizedDevices(): HasMany { return $this->hasMany(AuthorizedDevice::class) ->whereNotNull('authorized_at') ->orderBy('created_at', 'desc'); } - public function unreadNotifications() + public function unreadNotifications(): MorphMany { return $this->notifications()->whereNull('read_at'); } - public function notifications() + public function notifications(): MorphMany { return $this->morphMany(DatabaseNotification::class, 'notifiable') ->whereNotNull('read_at') diff --git a/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php b/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php index 5dfb905..f32de73 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php @@ -16,7 +16,6 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Notification; use Jenssegers\Agent\Agent; -use Sujip\Ipstack\Ipstack; class LoginController extends Controller { @@ -140,7 +139,7 @@ private function getDeviceInfo(Request $request) $agent->setUserAgent($request->userAgent()); $agent->setHttpHeaders($request->headers); - $ipstack = new Ipstack($request->ip()); + $geoip = geoip($request->ip()); return [ 'user_id' => auth()->id(), @@ -150,16 +149,15 @@ private function getDeviceInfo(Request $request) 'platform_version' => $agent->version($agent->platform()), 'browser' => $agent->browser(), 'browser_version' => $agent->version($agent->browser()), - 'city' => $ipstack->city(), - 'region_code' => $ipstack->regionCode(), - 'region_name' => $ipstack->region(), - 'country_code' => $ipstack->countryCode(), - 'country_name' => $ipstack->country(), - 'continent_code' => $ipstack->continentCode(), - 'continent_name' => $ipstack->continent(), - 'latitude' => $ipstack->latitude(), - 'longitude' => $ipstack->longitude(), - 'zipcode' => $ipstack->zip(), + 'city' => $geoip->getAttribute('city'), + 'region_code' => $geoip->getAttribute('state'), + 'region_name' => $geoip->getAttribute('state_name'), + 'country_code' => $geoip->getAttribute('iso_code'), + 'country_name' => $geoip->getAttribute('country'), + 'continent_code' => $geoip->getAttribute('continent'), + 'latitude' => $geoip->getAttribute('lat'), + 'longitude' => $geoip->getAttribute('lon'), + 'zipcode' => $geoip->getAttribute('postal_code'), ]; } diff --git a/modular-structure/app/Domain/Users/Providers/RouteServiceProvider.php b/modular-structure/app/Domain/Users/Providers/RouteServiceProvider.php index 3e1bf4b..fdb6dd1 100644 --- a/modular-structure/app/Domain/Users/Providers/RouteServiceProvider.php +++ b/modular-structure/app/Domain/Users/Providers/RouteServiceProvider.php @@ -13,11 +13,19 @@ use App\Domain\Users\Http\Controllers\TwoFactorAuthenticationController; use App\Domain\Users\Http\Controllers\UserController; use App\Domain\Users\Http\Controllers\UtilController; +use Illuminate\Cache\RateLimiting\Limit; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider; +use Illuminate\Http\Request; use Illuminate\Routing\Router; +use Illuminate\Support\Facades\RateLimiter; class RouteServiceProvider extends ServiceProvider { + public function boot() + { + $this->configureRateLimiting(); + } + public function map(Router $router): void { if (config('register.api_routes')) { @@ -46,12 +54,12 @@ private function mapRoutesWhenGuest(Router $router): void ->group(['middleware' => 'guest'], function () use ($router) { $router ->post('email/verify/{token}', [EmailVerificationController::class, 'verify']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.email.verify'); $router ->post('devices/authorize/{token}', [AuthorizeDeviceController::class, 'authorizeDevice']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.device.authorize'); $router @@ -64,12 +72,12 @@ private function mapRoutesWhenGuest(Router $router): void $router ->post('password/email', [ForgotPasswordController::class, 'sendResetLinkEmail']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.reset.email-link'); $router ->post('password/reset', [ResetPasswordController::class, 'reset']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.reset.password'); }); } @@ -128,7 +136,7 @@ private function mapRoutesWhen2faIsAvailable(Router $router): void $router ->delete('devices/{id}', [AuthorizeDeviceController::class, 'destroy']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.device.destroy'); }); } @@ -155,11 +163,25 @@ private function mapRoutesWhenAuthenticationDoesntMatter(Router $router): void { $router ->post('account/disable/{token}', [DisableAccountController::class, 'disable']) - ->middleware('throttle:5,1') + ->middleware('throttle:hard') ->name('api.account.disable'); $router ->get('ping', [UtilController::class, 'serverTime']) ->name('api.server.ping'); } + + /** + * Configure the rate limiters for the application. + */ + protected function configureRateLimiting(): void + { + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + }); + + RateLimiter::for('hard', function (Request $request) { + return Limit::perMinute(2)->by(optional($request->user())->id ?: $request->ip()); + }); + } } diff --git a/modular-structure/app/Domain/Users/Tests/Feature/AuthorizeDeviceControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/AuthorizeDeviceControllerTest.php index 49e2460..e32328f 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/AuthorizeDeviceControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/AuthorizeDeviceControllerTest.php @@ -12,14 +12,12 @@ class AuthorizeDeviceControllerTest extends TestCase { public function testAuthorizeDevice() { - $user = factory(User::class)->states([ - 'email_unverified', - ])->create([ + $user = User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); - $authorizedDevice = factory(AuthorizedDevice::class)->create([ + $authorizedDevice = AuthorizedDevice::factory()->create([ 'device' => 'device', 'platform' => 'platform', 'platform_version' => 'platform_version', @@ -36,9 +34,7 @@ public function testAuthorizeDevice() public function testCannotAuthorizeDeviceBecauseItsAlreadyAuthorized() { - factory(User::class)->states([ - 'email_unverified', - ])->create([ + User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); @@ -50,14 +46,12 @@ public function testCannotAuthorizeDeviceBecauseItsAlreadyAuthorized() public function testDestroyAuthorizedDevice() { - $user = factory(User::class)->states([ - 'email_unverified', - ])->create([ + $user = User::factory()->emailUnverified()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); - $authorizedDevice = factory(AuthorizedDevice::class)->create([ + $authorizedDevice = AuthorizedDevice::factory()->create([ 'device' => 'device', 'platform' => 'platform', 'platform_version' => 'platform_version', diff --git a/modular-structure/app/Domain/Users/Tests/Feature/DisableAccountControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/DisableAccountControllerTest.php index 3f21aec..9a595db 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/DisableAccountControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/DisableAccountControllerTest.php @@ -10,7 +10,7 @@ class DisableAccountControllerTest extends TestCase { public function testDisableAccount() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->postJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertOk() @@ -19,7 +19,7 @@ public function testDisableAccount() public function testDisableAccountWillFailBecauseMethodNotAllowed() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->putJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertStatus(Response::HTTP_METHOD_NOT_ALLOWED) @@ -28,7 +28,7 @@ public function testDisableAccountWillFailBecauseMethodNotAllowed() public function testTooManyRequests() { - $user = factory(User::class)->create(); + $user = User::factory()->create(); $this->postJson(route('api.account.disable', [$user->email_token_disable_account])) ->assertOk(); diff --git a/modular-structure/app/Domain/Users/Tests/Feature/LoginControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/LoginControllerTest.php index c6de379..2c6dc48 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/LoginControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/LoginControllerTest.php @@ -14,7 +14,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testLogin() @@ -68,7 +68,7 @@ public function testLogout() public function testCannotLoginBecauseEmailIsNotVerified() { - $this->user = factory(User::class)->states('email_unverified')->create(); + $this->user = User::factory()->emailUnverified()->create(); $this ->postJson(route('api.auth.login'), [ @@ -80,7 +80,7 @@ public function testCannotLoginBecauseEmailIsNotVerified() public function testCannotLoginBecauseAccountIsInactive() { - $this->user = factory(User::class)->states('inactive')->create(); + $this->user = User::factory()->inactive()->create(); $this ->postJson(route('api.auth.login'), [ diff --git a/modular-structure/app/Domain/Users/Tests/Feature/NotificationControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/NotificationControllerTest.php index fd48159..39d991d 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/NotificationControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/NotificationControllerTest.php @@ -13,7 +13,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testVisualizeAllNotifications() diff --git a/modular-structure/app/Domain/Users/Tests/Feature/PasswordResetListenerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/PasswordResetListenerTest.php index 541cf3e..50aceef 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/PasswordResetListenerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/PasswordResetListenerTest.php @@ -18,7 +18,7 @@ public function setUp(): void parent::setUp(); $this->passwordResetListener = $this->app->make(PasswordResetListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/modular-structure/app/Domain/Users/Tests/Feature/RegisterControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/RegisterControllerTest.php index f04a4cf..71e7310 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/RegisterControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/RegisterControllerTest.php @@ -59,7 +59,7 @@ public function testCannotRegisterBecausePasswordsNotMatch() public function testCannotRegisterBecauseEmailAlreadyRegistered() { - factory(User::class)->create([ + User::factory()->create([ 'email' => 'test@test.com', 'password' => bcrypt('secretxxx'), ]); @@ -75,7 +75,7 @@ public function testCannotRegisterBecauseEmailAlreadyRegistered() public function testVerifyEmail() { - $user = factory(User::class)->create([ + $user = User::factory()->create([ 'is_active' => 1, 'email_verified_at' => null, 'email_token_confirmation' => Uuid::uuid4(), @@ -90,7 +90,7 @@ public function testVerifyEmail() public function testInvalidVerifyEmailToken() { - factory(User::class)->create([ + User::factory()->create([ 'is_active' => 1, 'email_verified_at' => null, 'email' => 'test@test.com', diff --git a/modular-structure/app/Domain/Users/Tests/Feature/ResetPasswordControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/ResetPasswordControllerTest.php index d676e31..f8f4f40 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/ResetPasswordControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/ResetPasswordControllerTest.php @@ -21,7 +21,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testSubmitPasswordReset() diff --git a/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationControllerTest.php index c84c5f2..a308177 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationControllerTest.php @@ -15,7 +15,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testGenerate2faSecret() diff --git a/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php index 3acaeaf..9e9ea86 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/TwoFactorAuthenticationWasDisabledListenerTest.php @@ -18,7 +18,7 @@ public function setUp(): void parent::setUp(); $this->twoFactorAuthenticationWasDisabledListener = $this->app->make(TwoFactorAuthenticationWasDisabledListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/modular-structure/app/Domain/Users/Tests/Feature/UserControllerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/UserControllerTest.php index 05ce819..b778bf3 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/UserControllerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/UserControllerTest.php @@ -19,7 +19,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } /** @@ -106,8 +106,8 @@ public function testShowMe() 'unreadnotifications', ]; - factory(LoginHistory::class)->create(['user_id' => $this->user->id]); - factory(AuthorizedDevice::class)->create(['user_id' => $this->user->id]); + LoginHistory::factory()->create(['user_id' => $this->user->id]); + AuthorizedDevice::factory()->create(['user_id' => $this->user->id]); $this->actingAs($this->user) ->getJson(route('api.me') . '?include=' . implode(',', $includes)) @@ -134,9 +134,9 @@ public function testShow() 'unreadnotifications', ]; - $user2 = factory(User::class)->create(); - factory(LoginHistory::class)->create(['user_id' => $user2->id]); - factory(AuthorizedDevice::class)->create(['user_id' => $user2->id]); + $user2 = User::factory()->create(); + LoginHistory::factory()->create(['user_id' => $user2->id]); + AuthorizedDevice::factory()->create(['user_id' => $user2->id]); $this ->actingAs($this->user) @@ -183,7 +183,7 @@ public function testCannotShowBecauseUnauthenticated() */ public function testCannotShowBecauseUnauthorized() { - $user2 = factory(User::class)->create(); + $user2 = User::factory()->create(); $this ->actingAs($this->user) @@ -217,7 +217,7 @@ public function testCannotUpdateBecauseUnauthorized() { Permission::create(['name' => 'update users']); - $user2 = factory(User::class)->create(); + $user2 = User::factory()->create(); $this ->actingAs($this->user) diff --git a/modular-structure/app/Domain/Users/Tests/Feature/UserRegisteredListenerTest.php b/modular-structure/app/Domain/Users/Tests/Feature/UserRegisteredListenerTest.php index f452493..0e89857 100644 --- a/modular-structure/app/Domain/Users/Tests/Feature/UserRegisteredListenerTest.php +++ b/modular-structure/app/Domain/Users/Tests/Feature/UserRegisteredListenerTest.php @@ -20,7 +20,7 @@ public function setUp(): void parent::setUp(); $this->userRegisteredListener = $this->app->make(UserRegisteredListener::class); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testHandle() diff --git a/modular-structure/app/Domain/Users/Tests/Unit/AuthorizedDeviceTest.php b/modular-structure/app/Domain/Users/Tests/Unit/AuthorizedDeviceTest.php index 3aaffc5..049c3e2 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/AuthorizedDeviceTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/AuthorizedDeviceTest.php @@ -14,8 +14,8 @@ public function setUp(): void { parent::setUp(); - $user = factory(User::class)->create(); - $this->authorizedDevice = factory(AuthorizedDevice::class)->make(['user_id' => $user->id]); + $user = User::factory()->create(); + $this->authorizedDevice = AuthorizedDevice::factory()->make(['user_id' => $user->id]); } public function testUserRelationship() diff --git a/modular-structure/app/Domain/Users/Tests/Unit/CurrentPasswordRuleTest.php b/modular-structure/app/Domain/Users/Tests/Unit/CurrentPasswordRuleTest.php index 46e44af..d7f9ccb 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/CurrentPasswordRuleTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/CurrentPasswordRuleTest.php @@ -16,7 +16,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); $this->rule = new CurrentPasswordRule(); } diff --git a/modular-structure/app/Domain/Users/Tests/Unit/LoginHistoryTest.php b/modular-structure/app/Domain/Users/Tests/Unit/LoginHistoryTest.php index e20f2bd..dcdd0c8 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/LoginHistoryTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/LoginHistoryTest.php @@ -14,8 +14,8 @@ public function setUp(): void { parent::setUp(); - $user = factory(User::class)->create(); - $this->loginHistory = factory(LoginHistory::class)->make(['user_id' => $user->id]); + $user = User::factory()->create(); + $this->loginHistory = LoginHistory::factory()->make(['user_id' => $user->id]); } public function testUserRelationship() diff --git a/modular-structure/app/Domain/Users/Tests/Unit/NotificationsTest.php b/modular-structure/app/Domain/Users/Tests/Unit/NotificationsTest.php index 068b07c..ff452c3 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/NotificationsTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/NotificationsTest.php @@ -21,7 +21,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testVerifyEmailNotification() diff --git a/modular-structure/app/Domain/Users/Tests/Unit/UserRepositoryTest.php b/modular-structure/app/Domain/Users/Tests/Unit/UserRepositoryTest.php index 10f8fbc..e17936d 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/UserRepositoryTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/UserRepositoryTest.php @@ -16,7 +16,7 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); $this->userRepository = $this->app->make(UserRepository::class); } diff --git a/modular-structure/app/Domain/Users/Tests/Unit/UserTest.php b/modular-structure/app/Domain/Users/Tests/Unit/UserTest.php index 066bfe1..2145552 100644 --- a/modular-structure/app/Domain/Users/Tests/Unit/UserTest.php +++ b/modular-structure/app/Domain/Users/Tests/Unit/UserTest.php @@ -15,18 +15,18 @@ public function setUp(): void { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } public function testLoginHistoriesRelationship() { - factory(LoginHistory::class)->create(['user_id' => $this->user->id]); + LoginHistory::factory()->create(['user_id' => $this->user->id]); $this->assertNotNull($this->user->loginHistories); } public function testAuthorizedDevicesRelationship() { - factory(AuthorizedDevice::class)->create(['user_id' => $this->user->id]); + AuthorizedDevice::factory()->create(['user_id' => $this->user->id]); $this->assertNotNull($this->user->authorizedDevices); } } diff --git a/modular-structure/app/Infrastructure/Abstracts/ModelFactory.php b/modular-structure/app/Infrastructure/Abstracts/ModelFactory.php deleted file mode 100644 index 2ef6574..0000000 --- a/modular-structure/app/Infrastructure/Abstracts/ModelFactory.php +++ /dev/null @@ -1,45 +0,0 @@ -factory = app()->make(Factory::class); - $this->faker = app()->make(Generator::class); - } - - public function define() - { - $this->states(); - - $this->factory->define($this->model, function () { - return $this->fields(); - }); - } - - abstract public function states(); - - /** - * @return array - * @throws \Exception - */ - abstract public function fields(); -} diff --git a/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php b/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php index 77f3e04..18c2fd1 100644 --- a/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php +++ b/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php @@ -67,7 +67,6 @@ public function boot() { $this->registerPolicies(); $this->registerCommands(); - $this->registerFactories(); $this->registerMigrations(); $this->registerTranslations(); } @@ -96,18 +95,6 @@ protected function registerCommands() } } - /** - * Register Model Factories. - */ - protected function registerFactories() - { - if ($this->hasFactories && config('register.factories')) { - collect($this->factories)->each(function ($factoryName) { - (new $factoryName())->define(); - }); - } - } - /** * Register domain migrations. * diff --git a/modular-structure/composer.json b/modular-structure/composer.json index b9e35af..165c5da 100644 --- a/modular-structure/composer.json +++ b/modular-structure/composer.json @@ -13,42 +13,39 @@ ], "license": "MIT", "require": { - "php": "^7.4", + "php": "^8.0", "ext-bcmath": "*", "ext-json": "*", "ext-pcntl": "*", "ext-pdo": "*", "fideloper/proxy": "^4.1", - "fntneves/laravel-transactional-events": "^1.8", + "fntneves/laravel-transactional-events": "^2.0", "ibrunotome/google2fa-laravel": "^1.0", "jenssegers/agent": "^2.6", - "laravel/framework": "^7.24", - "laravel/horizon": "^4.0", - "laravel/slack-notification-channel": "^2.0", + "laravel/framework": "^8.0", + "laravel/horizon": "^5.0", "laravel/tinker": "^2.0", - "laravel/ui": "^2.2", + "laravel/ui": "^3.2", "league/flysystem-aws-s3-v3": "^1.0", - "owen-it/laravel-auditing": "^10.0", + "owen-it/laravel-auditing": "^12.0", "spatie/laravel-permission": "^3.0", "spatie/laravel-query-builder": "^3.0", - "sudiptpa/ipstack": "^1.3", - "tymon/jwt-auth": "1.0.0" + "torann/geoip": "^3.0", + "tymon/jwt-auth": "dev-develop" }, "require-dev": { "barryvdh/laravel-ide-helper": "^2.7", - "facade/ignition": "^2.0", - "fzaninotto/faker": "^1.9.1", + "facade/ignition": "^2.3.6", + "fakerphp/faker": "^1.13.0", "mockery/mockery": "^1.0", - "nunomaduro/collision": "^4.1", - "nunomaduro/phpinsights": "^1.0", + "nunomaduro/collision": "^5.0", + "nunomaduro/phpinsights": "dev-master", "phpunit/phpunit": "^9.0" }, "autoload": { - "classmap": [ - "database/seeds" - ], "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/" } }, "autoload-dev": { @@ -78,6 +75,6 @@ "sort-packages": true, "optimize-autoloader": true }, - "minimum-stability": "RC", + "minimum-stability": "dev", "prefer-stable": true } diff --git a/modular-structure/composer.lock b/modular-structure/composer.lock index 0a9e9e1..1d5a19d 100644 --- a/modular-structure/composer.lock +++ b/modular-structure/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "0569f03234896555097fb4881ebf1292", + "content-hash": "86624fe4dd9b7f24899fd723ec4d6374", "packages": [ { "name": "aws/aws-sdk-php", - "version": "3.178.1", + "version": "3.178.5", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "45692b97e12a2eed540c0afd106f143aad15e622" + "reference": "5a268a20272c0c9171570ed57f68b629e966deab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/45692b97e12a2eed540c0afd106f143aad15e622", - "reference": "45692b97e12a2eed540c0afd106f143aad15e622", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/5a268a20272c0c9171570ed57f68b629e966deab", + "reference": "5a268a20272c0c9171570ed57f68b629e966deab", "shasum": "" }, "require": { @@ -92,9 +92,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.178.1" + "source": "https://github.com/aws/aws-sdk-php/tree/3.178.5" }, - "time": "2021-04-09T18:13:02+00:00" + "time": "2021-04-15T18:12:46+00:00" }, { "name": "brick/math", @@ -152,65 +152,6 @@ ], "time": "2021-01-20T22:51:39+00:00" }, - { - "name": "cakephp/chronos", - "version": "2.1.2", - "source": { - "type": "git", - "url": "https://github.com/cakephp/chronos.git", - "reference": "1d187c71587c97520c00491f626e0f255144953e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cakephp/chronos/zipball/1d187c71587c97520c00491f626e0f255144953e", - "reference": "1d187c71587c97520c00491f626e0f255144953e", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "cakephp/cakephp-codesniffer": "^4.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Cake\\Chronos\\": "src/" - }, - "files": [ - "src/carbon_compat.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - }, - { - "name": "The CakePHP Team", - "homepage": "http://cakephp.org" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://cakephp.org", - "keywords": [ - "date", - "datetime", - "time" - ], - "support": { - "irc": "irc://irc.freenode.org/cakephp", - "issues": "https://github.com/cakephp/chronos/issues", - "source": "https://github.com/cakephp/chronos" - }, - "time": "2021-04-07T01:06:46+00:00" - }, { "name": "doctrine/inflector", "version": "2.0.3", @@ -388,30 +329,32 @@ }, { "name": "dragonmantank/cron-expression", - "version": "v2.3.1", + "version": "v3.1.0", "source": { "type": "git", "url": "https://github.com/dragonmantank/cron-expression.git", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2" + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/65b2d8ee1f10915efb3b55597da3404f096acba2", - "reference": "65b2d8ee1f10915efb3b55597da3404f096acba2", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", "shasum": "" }, "require": { - "php": "^7.0|^8.0" + "php": "^7.2|^8.0", + "webmozart/assert": "^1.7.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^6.4|^7.0|^8.0|^9.0" + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12.7", + "phpunit/phpunit": "^7.0|^8.0|^9.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.3-dev" - } - }, "autoload": { "psr-4": { "Cron\\": "src/Cron/" @@ -422,11 +365,6 @@ "MIT" ], "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, { "name": "Chris Tankersley", "email": "chris@ctankersley.com", @@ -440,7 +378,7 @@ ], "support": { "issues": "https://github.com/dragonmantank/cron-expression/issues", - "source": "https://github.com/dragonmantank/cron-expression/tree/v2.3.1" + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0" }, "funding": [ { @@ -448,7 +386,7 @@ "type": "github" } ], - "time": "2020-10-13T00:52:37+00:00" + "time": "2020-11-24T19:55:57+00:00" }, { "name": "egulias/email-validator", @@ -578,26 +516,26 @@ }, { "name": "fntneves/laravel-transactional-events", - "version": "1.8.11", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/fntneves/laravel-transactional-events.git", - "reference": "86627e50c3279ae0c8807a27518573bb11e67069" + "reference": "af0665a6a4fda7971716279db7e9a9119926d2ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fntneves/laravel-transactional-events/zipball/86627e50c3279ae0c8807a27518573bb11e67069", - "reference": "86627e50c3279ae0c8807a27518573bb11e67069", + "url": "https://api.github.com/repos/fntneves/laravel-transactional-events/zipball/af0665a6a4fda7971716279db7e9a9119926d2ef", + "reference": "af0665a6a4fda7971716279db7e9a9119926d2ef", "shasum": "" }, "require": { - "illuminate/database": "~5.8.0|^6.0|^7.0", - "illuminate/events": "~5.8.0|^6.0|^7.0", - "illuminate/support": "~5.8.0|^6.0|^7.0", + "illuminate/database": "^8.0", + "illuminate/events": "^8.0", + "illuminate/support": "^8.0", "loophp/phptree": "^2.5" }, "require-dev": { - "orchestra/testbench": "~3.8.0|~4.0|^5.0" + "orchestra/testbench": "^6.0" }, "type": "library", "extra": { @@ -628,9 +566,75 @@ "description": "Transaction-aware Event Dispatcher for Laravel", "support": { "issues": "https://github.com/fntneves/laravel-transactional-events/issues", - "source": "https://github.com/fntneves/laravel-transactional-events/tree/1.8.11" + "source": "https://github.com/fntneves/laravel-transactional-events/tree/2.0.1" + }, + "time": "2020-10-13T12:21:49+00:00" + }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.1", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/7e279d2cd5d7fbb156ce46daada972355cea27bb", + "reference": "7e279d2cd5d7fbb156ce46daada972355cea27bb", + "shasum": "" + }, + "require": { + "php": "^7.0|^8.0", + "phpoption/phpoption": "^1.7.3" + }, + "require-dev": { + "phpunit/phpunit": "^6.5|^7.5|^8.5|^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com" + } + ], + "description": "An Implementation Of The Result Type", + "keywords": [ + "Graham Campbell", + "GrahamCampbell", + "Result Type", + "Result-Type", + "result" + ], + "support": { + "issues": "https://github.com/GrahamCampbell/Result-Type/issues", + "source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.0.1" }, - "time": "2020-10-13T12:19:34+00:00" + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2020-04-13T13:17:36+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1074,21 +1078,21 @@ }, { "name": "laravel/framework", - "version": "v7.30.4", + "version": "v8.37.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3" + "reference": "cf4082973abc796ec285190f0603380021f6d26f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9dd38140dc2924daa1a020a3d7a45f9ceff03df3", - "reference": "9dd38140dc2924daa1a020a3d7a45f9ceff03df3", + "url": "https://api.github.com/repos/laravel/framework/zipball/cf4082973abc796ec285190f0603380021f6d26f", + "reference": "cf4082973abc796ec285190f0603380021f6d26f", "shasum": "" }, "require": { "doctrine/inflector": "^1.4|^2.0", - "dragonmantank/cron-expression": "^2.3.1", + "dragonmantank/cron-expression": "^3.0.2", "egulias/email-validator": "^2.1.10", "ext-json": "*", "ext-mbstring": "*", @@ -1098,23 +1102,22 @@ "monolog/monolog": "^2.0", "nesbot/carbon": "^2.31", "opis/closure": "^3.6", - "php": "^7.2.5|^8.0", + "php": "^7.3|^8.0", "psr/container": "^1.0", "psr/simple-cache": "^1.0", - "ramsey/uuid": "^3.7|^4.0", + "ramsey/uuid": "^4.0", "swiftmailer/swiftmailer": "^6.0", - "symfony/console": "^5.0", - "symfony/error-handler": "^5.0", - "symfony/finder": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/mime": "^5.0", - "symfony/polyfill-php73": "^1.17", - "symfony/process": "^5.0", - "symfony/routing": "^5.0", - "symfony/var-dumper": "^5.0", + "symfony/console": "^5.1.4", + "symfony/error-handler": "^5.1.4", + "symfony/finder": "^5.1.4", + "symfony/http-foundation": "^5.1.4", + "symfony/http-kernel": "^5.1.4", + "symfony/mime": "^5.1.4", + "symfony/process": "^5.1.4", + "symfony/routing": "^5.1.4", + "symfony/var-dumper": "^5.1.4", "tijsverkoyen/css-to-inline-styles": "^2.2.2", - "vlucas/phpdotenv": "^4.0", + "vlucas/phpdotenv": "^5.2", "voku/portable-ascii": "^1.4.8" }, "conflict": { @@ -1128,6 +1131,7 @@ "illuminate/broadcasting": "self.version", "illuminate/bus": "self.version", "illuminate/cache": "self.version", + "illuminate/collections": "self.version", "illuminate/config": "self.version", "illuminate/console": "self.version", "illuminate/container": "self.version", @@ -1140,6 +1144,7 @@ "illuminate/hashing": "self.version", "illuminate/http": "self.version", "illuminate/log": "self.version", + "illuminate/macroable": "self.version", "illuminate/mail": "self.version", "illuminate/notifications": "self.version", "illuminate/pagination": "self.version", @@ -1156,21 +1161,21 @@ }, "require-dev": { "aws/aws-sdk-php": "^3.155", - "doctrine/dbal": "^2.6", + "doctrine/dbal": "^2.6|^3.0", "filp/whoops": "^2.8", - "guzzlehttp/guzzle": "^6.3.1|^7.0.1", + "guzzlehttp/guzzle": "^6.5.5|^7.0.1", "league/flysystem-cached-adapter": "^1.0", - "mockery/mockery": "~1.3.3|^1.4.2", - "moontoast/math": "^1.1", - "orchestra/testbench-core": "^5.8", + "mockery/mockery": "^1.4.2", + "orchestra/testbench-core": "^6.8", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.4|^9.3.3", + "phpunit/phpunit": "^8.5.8|^9.3.3", "predis/predis": "^1.1.1", - "symfony/cache": "^5.0" + "symfony/cache": "^5.1.4" }, "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.155).", - "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "brianium/paratest": "Required to run tests in parallel (^6.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", "ext-ftp": "Required to use the Flysystem FTP driver.", "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-memcached": "Required to use the memcache cache driver.", @@ -1179,37 +1184,42 @@ "ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).", "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", "filp/whoops": "Required for friendly error pages in development (^2.8).", - "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.3.1|^7.0.1).", + "guzzlehttp/guzzle": "Required to use the HTTP Client, Mailgun mail driver and the ping methods on schedules (^6.5.5|^7.0.1).", "laravel/tinker": "Required to use the tinker console command (^2.0).", "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (^1.0).", "league/flysystem-cached-adapter": "Required to use the Flysystem cache (^1.0).", "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (^1.0).", - "mockery/mockery": "Required to use mocking (~1.3.3|^1.4.2).", - "moontoast/math": "Required to use ordered UUIDs (^1.1).", + "mockery/mockery": "Required to use mocking (^1.4.2).", "nyholm/psr7": "Required to use PSR-7 bridging features (^1.2).", "pda/pheanstalk": "Required to use the beanstalk queue driver (^4.0).", - "phpunit/phpunit": "Required to use assertions and run tests (^8.4|^9.3.3).", + "phpunit/phpunit": "Required to use assertions and run tests (^8.5.8|^9.3.3).", "predis/predis": "Required to use the predis connector (^1.1.2).", "psr/http-message": "Required to allow Storage::put to accept a StreamInterface (^1.0).", - "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0).", - "symfony/cache": "Required to PSR-6 cache bridge (^5.0).", - "symfony/filesystem": "Required to create relative storage directory symbolic links (^5.0).", + "pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^4.0|^5.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.1.4).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.1.4).", "symfony/psr-http-message-bridge": "Required to use PSR-7 bridging features (^2.0).", "wildbit/swiftmailer-postmark": "Required to use Postmark mail driver (^3.0)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "7.x-dev" + "dev-master": "8.x-dev" } }, "autoload": { "files": [ + "src/Illuminate/Collections/helpers.php", + "src/Illuminate/Events/functions.php", "src/Illuminate/Foundation/helpers.php", "src/Illuminate/Support/helpers.php" ], "psr-4": { - "Illuminate\\": "src/Illuminate/" + "Illuminate\\": "src/Illuminate/", + "Illuminate\\Support\\": [ + "src/Illuminate/Macroable/", + "src/Illuminate/Collections/" + ] } }, "notification-url": "https://packagist.org/downloads/", @@ -1232,39 +1242,39 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-01-21T14:10:48+00:00" + "time": "2021-04-13T13:49:49+00:00" }, { "name": "laravel/horizon", - "version": "v4.3.5", + "version": "v5.7.5", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "b3fba0daaaaf5e84197b06dd25f3b27bb7301171" + "reference": "9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/b3fba0daaaaf5e84197b06dd25f3b27bb7301171", - "reference": "b3fba0daaaaf5e84197b06dd25f3b27bb7301171", + "url": "https://api.github.com/repos/laravel/horizon/zipball/9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8", + "reference": "9bf0ef4873d9e52f58a9cd1de69dcdd98a5c4fe8", "shasum": "" }, "require": { - "cakephp/chronos": "^2.0", "ext-json": "*", "ext-pcntl": "*", "ext-posix": "*", - "illuminate/contracts": "^7.0", - "illuminate/queue": "^7.0", - "illuminate/support": "^7.0", - "php": "^7.2", - "ramsey/uuid": "^3.5|^4.0", + "illuminate/contracts": "^8.17", + "illuminate/queue": "^8.17", + "illuminate/support": "^8.17", + "nesbot/carbon": "^2.17", + "php": "^7.3|^8.0", + "ramsey/uuid": "^4.0", "symfony/error-handler": "^5.0", "symfony/process": "^5.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^5.0", - "phpunit/phpunit": "^8.0", + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.0", "predis/predis": "^1.1" }, "suggest": { @@ -1274,7 +1284,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" }, "laravel": { "providers": [ @@ -1307,70 +1317,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/4.x" - }, - "time": "2020-09-08T13:19:23+00:00" - }, - { - "name": "laravel/slack-notification-channel", - "version": "v2.3.1", - "source": { - "type": "git", - "url": "https://github.com/laravel/slack-notification-channel.git", - "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", - "reference": "f428e76b8d0a0a2ff413ab225eeb829b9a8ffc20", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0|^7.0", - "illuminate/notifications": "~5.8.0|^6.0|^7.0|^8.0", - "php": "^7.1.3|^8.0" - }, - "require-dev": { - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.x-dev" - }, - "laravel": { - "providers": [ - "Illuminate\\Notifications\\SlackChannelServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Notifications\\": "src/" - } + "source": "https://github.com/laravel/horizon/tree/v5.7.5" }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "Slack Notification Channel for laravel.", - "keywords": [ - "laravel", - "notifications", - "slack" - ], - "support": { - "issues": "https://github.com/laravel/slack-notification-channel/issues", - "source": "https://github.com/laravel/slack-notification-channel/tree/v2.3.1" - }, - "time": "2021-01-26T20:04:54+00:00" + "time": "2021-04-06T14:17:52+00:00" }, { "name": "laravel/tinker", @@ -1442,26 +1391,29 @@ }, { "name": "laravel/ui", - "version": "v2.5.0", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d" + "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/d01a705763c243b07be795e9d1bb47f89260f73d", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d", + "url": "https://api.github.com/repos/laravel/ui/zipball/a1f82c6283c8373ea1958b8a27c3d5c98cade351", + "reference": "a1f82c6283c8373ea1958b8a27c3d5c98cade351", "shasum": "" }, "require": { - "illuminate/console": "^7.0", - "illuminate/filesystem": "^7.0", - "illuminate/support": "^7.0", - "php": "^7.2.5|^8.0" + "illuminate/console": "^8.0", + "illuminate/filesystem": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0" }, "type": "library", "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, "laravel": { "providers": [ "Laravel\\Ui\\UiServiceProvider" @@ -1491,38 +1443,38 @@ ], "support": { "issues": "https://github.com/laravel/ui/issues", - "source": "https://github.com/laravel/ui/tree/v2.5.0" + "source": "https://github.com/laravel/ui/tree/v3.2.0" }, - "time": "2020-11-03T19:45:19+00:00" + "time": "2021-01-06T19:20:22+00:00" }, { "name": "lcobucci/jwt", - "version": "3.4.5", + "version": "3.2.5", "source": { "type": "git", "url": "https://github.com/lcobucci/jwt.git", - "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1" + "reference": "82be04b4753f8b7693b62852b7eab30f97524f9b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/jwt/zipball/511629a54465e89a31d3d7e4cf0935feab8b14c1", - "reference": "511629a54465e89a31d3d7e4cf0935feab8b14c1", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/82be04b4753f8b7693b62852b7eab30f97524f9b", + "reference": "82be04b4753f8b7693b62852b7eab30f97524f9b", "shasum": "" }, "require": { - "ext-mbstring": "*", "ext-openssl": "*", - "php": "^5.6 || ^7.0" + "php": ">=5.5" }, "require-dev": { + "mdanter/ecc": "~0.3.1", "mikey179/vfsstream": "~1.5", "phpmd/phpmd": "~2.2", "phpunit/php-invoker": "~1.1", - "phpunit/phpunit": "^5.7 || ^7.3", + "phpunit/phpunit": "~4.5", "squizlabs/php_codesniffer": "~2.3" }, "suggest": { - "lcobucci/clock": "*" + "mdanter/ecc": "Required to use Elliptic Curves based algorithms." }, "type": "library", "extra": { @@ -1533,12 +1485,7 @@ "autoload": { "psr-4": { "Lcobucci\\JWT\\": "src" - }, - "files": [ - "compat/class-aliases.php", - "compat/json-exception-polyfill.php", - "compat/lcobucci-clock-polyfill.php" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1558,19 +1505,9 @@ ], "support": { "issues": "https://github.com/lcobucci/jwt/issues", - "source": "https://github.com/lcobucci/jwt/tree/3.4.5" + "source": "https://github.com/lcobucci/jwt/tree/3.2" }, - "funding": [ - { - "url": "https://github.com/lcobucci", - "type": "github" - }, - { - "url": "https://www.patreon.com/lcobucci", - "type": "patreon" - } - ], - "time": "2021-02-16T09:40:01+00:00" + "time": "2018-11-11T12:22:26+00:00" }, { "name": "league/commonmark", @@ -2443,28 +2380,28 @@ }, { "name": "owen-it/laravel-auditing", - "version": "v10.0.0", + "version": "v12.0.0", "source": { "type": "git", "url": "https://github.com/owen-it/laravel-auditing.git", - "reference": "50b0d9bc8d47a6fd873427c012c6710850e73a34" + "reference": "5659c736f17aa75805b60c0d0a23783f3bf5c2a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/owen-it/laravel-auditing/zipball/50b0d9bc8d47a6fd873427c012c6710850e73a34", - "reference": "50b0d9bc8d47a6fd873427c012c6710850e73a34", + "url": "https://api.github.com/repos/owen-it/laravel-auditing/zipball/5659c736f17aa75805b60c0d0a23783f3bf5c2a1", + "reference": "5659c736f17aa75805b60c0d0a23783f3bf5c2a1", "shasum": "" }, "require": { - "illuminate/console": "^5.8|^6.0|^7.0", - "illuminate/database": "^5.8|^6.0|^7.0", - "illuminate/filesystem": "^5.8|^6.0|^7.0", - "php": ">=7.2.5" + "illuminate/console": "^6.0|^7.0|^8.0", + "illuminate/database": "^6.0|^7.0|^8.0", + "illuminate/filesystem": "^6.0|^7.0|^8.0", + "php": "^7.3|^8.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^3.8", - "phpunit/phpunit": "^8.0", + "orchestra/testbench": "^4.0", + "phpunit/phpunit": "^9.0", "ramsey/uuid": "^3.0" }, "suggest": { @@ -2526,7 +2463,7 @@ "issues": "https://github.com/owen-it/laravel-auditing/issues", "source": "https://github.com/owen-it/laravel-auditing" }, - "time": "2020-03-23T22:49:02+00:00" + "time": "2020-12-15T19:19:43+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -3514,62 +3451,6 @@ ], "time": "2020-11-26T14:51:30+00:00" }, - { - "name": "sudiptpa/ipstack", - "version": "v1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sudiptpa/ipstack.git", - "reference": "381471a275d459599f243cd43c7d8761635b488f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sudiptpa/ipstack/zipball/381471a275d459599f243cd43c7d8761635b488f", - "reference": "381471a275d459599f243cd43c7d8761635b488f", - "shasum": "" - }, - "require": { - "php": "~7.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpro/grumphp": "^0.14.0", - "phpunit/phpunit": "~6.0", - "squizlabs/php_codesniffer": "^3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Sujip\\Ipstack\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Sujip Thapa", - "email": "sudiptpa@gmail.com" - } - ], - "description": "A simple package for IP to Location implementation with PHP.", - "keywords": [ - "geoip", - "ip to location", - "ipstack" - ], - "support": { - "issues": "https://github.com/sudiptpa/ipstack/issues", - "source": "https://github.com/sudiptpa/ipstack/tree/master" - }, - "time": "2018-07-18T16:10:08+00:00" - }, { "name": "swiftmailer/swiftmailer", "version": "v6.2.7", @@ -5939,72 +5820,154 @@ "time": "2020-07-13T06:12:54+00:00" }, { - "name": "tymon/jwt-auth", - "version": "1.0.0", + "name": "torann/geoip", + "version": "3.0.2", "source": { "type": "git", - "url": "https://github.com/tymondesigns/jwt-auth.git", - "reference": "d4cf9fd2b98790712d3e6cd1094e5ff018431f19" + "url": "https://github.com/Torann/laravel-geoip.git", + "reference": "f16d5df66ecb6ba4ffaef52abef519fbc19596d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/d4cf9fd2b98790712d3e6cd1094e5ff018431f19", - "reference": "d4cf9fd2b98790712d3e6cd1094e5ff018431f19", + "url": "https://api.github.com/repos/Torann/laravel-geoip/zipball/f16d5df66ecb6ba4ffaef52abef519fbc19596d3", + "reference": "f16d5df66ecb6ba4ffaef52abef519fbc19596d3", "shasum": "" }, "require": { - "illuminate/auth": "^5.2|^6|^7", - "illuminate/contracts": "^5.2|^6|^7", - "illuminate/http": "^5.2|^6|^7", - "illuminate/support": "^5.2|^6|^7", - "lcobucci/jwt": "^3.2", - "namshi/jose": "^7.0", - "nesbot/carbon": "^1.0|^2.0", - "php": "^5.5.9|^7.0" + "illuminate/cache": "^8.0", + "illuminate/console": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.2 || ^8.0" }, "require-dev": { - "illuminate/console": "^5.2|^6|^7", - "illuminate/database": "^5.2|^6|^7", - "illuminate/routing": "^5.2|^6|^7", - "mockery/mockery": ">=0.9.9", - "phpunit/phpunit": "~4.8|~6.0" + "geoip2/geoip2": "~2.1", + "mockery/mockery": "^1.3", + "phpstan/phpstan": "^0.12.14", + "phpunit/phpunit": "^8.0", + "squizlabs/php_codesniffer": "^3.5", + "vlucas/phpdotenv": "^5.0" + }, + "suggest": { + "geoip2/geoip2": "Required to use the MaxMind database or web service with GeoIP (~2.1).", + "monolog/monolog": "Allows for storing location not found errors to the log" }, "type": "library", "extra": { "branch-alias": { - "dev-develop": "1.0-dev" + "dev-master": "1.0-dev" }, "laravel": { - "aliases": { - "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", - "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" - }, "providers": [ - "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" - ] + "Torann\\GeoIP\\GeoIPServiceProvider" + ], + "aliases": { + "GeoIP": "Torann\\GeoIP\\Facades\\GeoIP" + } } }, "autoload": { + "files": [ + "src/helpers.php" + ], "psr-4": { - "Tymon\\JWTAuth\\": "src/" + "Torann\\GeoIP\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-2-Clause" ], "authors": [ { - "name": "Sean Tymon", - "email": "tymon148@gmail.com", - "homepage": "https://tymon.xyz", - "role": "Developer" + "name": "Daniel Stainback", + "email": "torann@gmail.com" } ], - "description": "JSON Web Token Authentication for Laravel and Lumen", - "homepage": "https://github.com/tymondesigns/jwt-auth", + "description": "Support for multiple GeoIP services.", "keywords": [ - "Authentication", + "IP API", + "geoip", + "geolocation", + "infoDB", + "laravel", + "location", + "maxmind" + ], + "support": { + "issues": "https://github.com/Torann/laravel-geoip/issues", + "source": "https://github.com/Torann/laravel-geoip/tree/3.0.2" + }, + "time": "2020-12-21T19:12:11+00:00" + }, + { + "name": "tymon/jwt-auth", + "version": "dev-develop", + "source": { + "type": "git", + "url": "https://github.com/tymondesigns/jwt-auth.git", + "reference": "ab00f2d7cce5f043067aef7849cdc792de2df635" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tymondesigns/jwt-auth/zipball/ab00f2d7cce5f043067aef7849cdc792de2df635", + "reference": "ab00f2d7cce5f043067aef7849cdc792de2df635", + "shasum": "" + }, + "require": { + "illuminate/auth": "^5.2|^6|^7|^8", + "illuminate/contracts": "^5.2|^6|^7|^8", + "illuminate/http": "^5.2|^6|^7|^8", + "illuminate/support": "^5.2|^6|^7|^8", + "lcobucci/jwt": "<3.4", + "namshi/jose": "^7.0", + "nesbot/carbon": "^1.0|^2.0", + "php": "^7.2|^8.0" + }, + "require-dev": { + "illuminate/console": "^5.2|^6|^7|^8", + "illuminate/database": "^5.2|^6|^7|^8", + "illuminate/routing": "^5.2|^6|^7|^8", + "mockery/mockery": ">=0.9.9", + "phpunit/phpunit": "^8.5|^9.4", + "yoast/phpunit-polyfills": "^0.2.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "1.0-dev" + }, + "laravel": { + "aliases": { + "JWTAuth": "Tymon\\JWTAuth\\Facades\\JWTAuth", + "JWTFactory": "Tymon\\JWTAuth\\Facades\\JWTFactory" + }, + "providers": [ + "Tymon\\JWTAuth\\Providers\\LaravelServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Tymon\\JWTAuth\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sean Tymon", + "email": "tymon148@gmail.com", + "homepage": "https://tymon.xyz", + "role": "Developer" + } + ], + "description": "JSON Web Token Authentication for Laravel and Lumen", + "homepage": "https://github.com/tymondesigns/jwt-auth", + "keywords": [ + "Authentication", "JSON Web Token", "auth", "jwt", @@ -6020,41 +5983,43 @@ "type": "patreon" } ], - "time": "2020-03-04T11:21:28+00:00" + "time": "2021-02-02T14:44:28+00:00" }, { "name": "vlucas/phpdotenv", - "version": "v4.2.0", + "version": "v5.3.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "da64796370fc4eb03cc277088f6fede9fde88482" + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/da64796370fc4eb03cc277088f6fede9fde88482", - "reference": "da64796370fc4eb03cc277088f6fede9fde88482", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", + "reference": "b3eac5c7ac896e52deab4a99068e3f4ab12d9e56", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "phpoption/phpoption": "^1.7.3", - "symfony/polyfill-ctype": "^1.17" + "ext-pcre": "*", + "graham-campbell/result-type": "^1.0.1", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.7.4", + "symfony/polyfill-ctype": "^1.17", + "symfony/polyfill-mbstring": "^1.17", + "symfony/polyfill-php80": "^1.17" }, "require-dev": { "bamarni/composer-bin-plugin": "^1.4.1", "ext-filter": "*", - "ext-pcre": "*", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20" + "phpunit/phpunit": "^7.5.20 || ^8.5.14 || ^9.5.1" }, "suggest": { - "ext-filter": "Required to use the boolean validator.", - "ext-pcre": "Required to use most of the library." + "ext-filter": "Required to use the boolean validator." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.1-dev" + "dev-master": "5.3-dev" } }, "autoload": { @@ -6086,7 +6051,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v4.2.0" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.3.0" }, "funding": [ { @@ -6098,7 +6063,7 @@ "type": "tidelift" } ], - "time": "2021-01-20T15:11:48+00:00" + "time": "2021-01-20T15:23:13+00:00" }, { "name": "voku/portable-ascii", @@ -6173,49 +6138,111 @@ } ], "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ { "name": "barryvdh/laravel-ide-helper", - "version": "v2.8.2", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "5515cabea39b9cf55f98980d0f269dc9d85cfcca" + "reference": "73b1012b927633a1b4cd623c2e6b1678e6faef08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/5515cabea39b9cf55f98980d0f269dc9d85cfcca", - "reference": "5515cabea39b9cf55f98980d0f269dc9d85cfcca", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/73b1012b927633a1b4cd623c2e6b1678e6faef08", + "reference": "73b1012b927633a1b4cd623c2e6b1678e6faef08", "shasum": "" }, "require": { "barryvdh/reflection-docblock": "^2.0.6", "composer/composer": "^1.6 || ^2", - "doctrine/dbal": "~2.3", + "doctrine/dbal": "^2.6 || ^3", "ext-json": "*", - "illuminate/console": "^6 || ^7 || ^8", - "illuminate/filesystem": "^6 || ^7 || ^8", - "illuminate/support": "^6 || ^7 || ^8", - "php": ">=7.2", + "illuminate/console": "^8", + "illuminate/filesystem": "^8", + "illuminate/support": "^8", + "nikic/php-parser": "^4.7", + "php": "^7.3 || ^8.0", "phpdocumentor/type-resolver": "^1.1.0" }, "require-dev": { "ext-pdo_sqlite": "*", "friendsofphp/php-cs-fixer": "^2", - "illuminate/config": "^6 || ^7 || ^8", - "illuminate/view": "^6 || ^7 || ^8", - "mockery/mockery": "^1.3.3", - "orchestra/testbench": "^4 || ^5 || ^6", + "illuminate/config": "^8", + "illuminate/view": "^8", + "mockery/mockery": "^1.4", + "orchestra/testbench": "^6", "phpunit/phpunit": "^8.5 || ^9", - "spatie/phpunit-snapshot-assertions": "^1.4 || ^2.2 || ^3 || ^4", + "spatie/phpunit-snapshot-assertions": "^3 || ^4", "vimeo/psalm": "^3.12" }, + "suggest": { + "illuminate/events": "Required for automatic helper generation (^6|^7|^8)." + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "2.9-dev" }, "laravel": { "providers": [ @@ -6252,7 +6279,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", - "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.8.2" + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v2.10.0" }, "funding": [ { @@ -6260,7 +6287,7 @@ "type": "github" } ], - "time": "2020-12-06T08:55:05+00:00" + "time": "2021-04-09T06:17:55+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -6392,39 +6419,37 @@ }, { "name": "composer/composer", - "version": "1.10.21", + "version": "2.0.12", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c" + "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/04021432f4a9cbd9351dd166b8c193f42c36a39c", - "reference": "04021432f4a9cbd9351dd166b8c193f42c36a39c", + "url": "https://api.github.com/repos/composer/composer/zipball/6c12ce263da71641903e399c3ce8ecb08fd375fb", + "reference": "6c12ce263da71641903e399c3ce8ecb08fd375fb", "shasum": "" }, "require": { "composer/ca-bundle": "^1.0", - "composer/semver": "^1.0", + "composer/semver": "^3.0", "composer/spdx-licenses": "^1.2", "composer/xdebug-handler": "^1.1", "justinrainbow/json-schema": "^5.2.10", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1.0", + "react/promise": "^1.2 || ^2.7", "seld/jsonlint": "^1.4", "seld/phar-utils": "^1.0", - "symfony/console": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/filesystem": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/finder": "^2.7 || ^3.0 || ^4.0 || ^5.0", - "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" - }, - "conflict": { - "symfony/console": "2.8.38" + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0" }, "require-dev": { "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^4.2" + "symfony/phpunit-bridge": "^4.2 || ^5.0" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -6437,7 +6462,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -6453,12 +6478,12 @@ { "name": "Nils Adermann", "email": "naderman@naderman.de", - "homepage": "http://www.naderman.de" + "homepage": "https://www.naderman.de" }, { "name": "Jordi Boggiano", "email": "j.boggiano@seld.be", - "homepage": "http://seld.be" + "homepage": "https://seld.be" } ], "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", @@ -6471,7 +6496,80 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/1.10.21" + "source": "https://github.com/composer/composer/tree/2.0.12" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2021-04-01T08:14:59+00:00" + }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.1", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "reference": "7413f0b55a051e89485c5cb9f765fe24bb02a7b6", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "support": { + "issues": "https://github.com/composer/package-versions-deprecated/issues", + "source": "https://github.com/composer/package-versions-deprecated/tree/1.11.99.1" }, "funding": [ { @@ -6487,32 +6585,33 @@ "type": "tidelift" } ], - "time": "2021-04-01T07:16:35+00:00" + "time": "2020-11-11T10:22:58+00:00" }, { "name": "composer/semver", - "version": "1.7.2", + "version": "3.2.4", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a" + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/647490bbcaf7fc4891c58f47b825eb99d19c377a", - "reference": "647490bbcaf7fc4891c58f47b825eb99d19c377a", + "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", + "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5" + "phpstan/phpstan": "^0.12.54", + "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-main": "3.x-dev" } }, "autoload": { @@ -6551,7 +6650,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/1.7.2" + "source": "https://github.com/composer/semver/tree/3.2.4" }, "funding": [ { @@ -6567,7 +6666,7 @@ "type": "tidelift" } ], - "time": "2020-12-03T15:47:16+00:00" + "time": "2020-11-13T08:59:24+00:00" }, { "name": "composer/spdx-licenses", @@ -6954,32 +7053,33 @@ }, { "name": "doctrine/dbal", - "version": "2.13.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796" + "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/67d56d3203b33db29834e6b2fcdbfdc50535d796", - "reference": "67d56d3203b33db29834e6b2fcdbfdc50535d796", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/ee6d1260d5cc20ec506455a585945d7bdb98662c", + "reference": "ee6d1260d5cc20ec506455a585945d7bdb98662c", "shasum": "" }, "require": { + "composer/package-versions-deprecated": "^1.11.99", "doctrine/cache": "^1.0", - "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "php": "^7.3 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "8.2.0", - "jetbrains/phpstorm-stubs": "2020.2", - "phpstan/phpstan": "0.12.81", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.0", + "doctrine/coding-standard": "^8.1", + "jetbrains/phpstorm-stubs": "^2019.1", + "phpstan/phpstan": "^0.12.40", + "phpstan/phpstan-strict-rules": "^0.12.2", + "phpunit/phpunit": "^9.4", + "psalm/plugin-phpunit": "^0.10.0", "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", - "vimeo/psalm": "4.6.4" + "vimeo/psalm": "^3.17.2" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -6988,9 +7088,14 @@ "bin/doctrine-dbal" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -7033,14 +7138,13 @@ "queryobject", "sasql", "sql", - "sqlanywhere", "sqlite", "sqlserver", "sqlsrv" ], "support": { "issues": "https://github.com/doctrine/dbal/issues", - "source": "https://github.com/doctrine/dbal/tree/2.13.0" + "source": "https://github.com/doctrine/dbal/tree/3.0.0" }, "funding": [ { @@ -7056,50 +7160,7 @@ "type": "tidelift" } ], - "time": "2021-03-28T18:10:53+00:00" - }, - { - "name": "doctrine/deprecations", - "version": "v0.5.3", - "source": { - "type": "git", - "url": "https://github.com/doctrine/deprecations.git", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/9504165960a1f83cc1480e2be1dd0a0478561314", - "reference": "9504165960a1f83cc1480e2be1dd0a0478561314", - "shasum": "" - }, - "require": { - "php": "^7.1|^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^6.0|^7.0|^8.0", - "phpunit/phpunit": "^7.0|^8.0|^9.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Allows logging deprecations via PSR-3 logger implementation" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", - "homepage": "https://www.doctrine-project.org/", - "support": { - "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/v0.5.3" - }, - "time": "2021-03-21T12:59:47+00:00" + "time": "2020-11-15T18:20:41+00:00" }, { "name": "doctrine/event-manager", @@ -7266,16 +7327,16 @@ }, { "name": "facade/flare-client-php", - "version": "1.6.1", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/facade/flare-client-php.git", - "reference": "f2b0969f2d9594704be74dbeb25b201570a98098" + "reference": "6bf380035890cb0a09b9628c491ae3866b858522" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/flare-client-php/zipball/f2b0969f2d9594704be74dbeb25b201570a98098", - "reference": "f2b0969f2d9594704be74dbeb25b201570a98098", + "url": "https://api.github.com/repos/facade/flare-client-php/zipball/6bf380035890cb0a09b9628c491ae3866b858522", + "reference": "6bf380035890cb0a09b9628c491ae3866b858522", "shasum": "" }, "require": { @@ -7319,7 +7380,7 @@ ], "support": { "issues": "https://github.com/facade/flare-client-php/issues", - "source": "https://github.com/facade/flare-client-php/tree/1.6.1" + "source": "https://github.com/facade/flare-client-php/tree/1.7.0" }, "funding": [ { @@ -7327,7 +7388,7 @@ "type": "github" } ], - "time": "2021-04-08T08:50:01+00:00" + "time": "2021-04-12T09:30:36+00:00" }, { "name": "facade/ignition", @@ -7460,41 +7521,47 @@ "time": "2020-10-16T08:27:54+00:00" }, { - "name": "filp/whoops", - "version": "2.12.0", + "name": "fakerphp/faker", + "version": "v1.14.1", "source": { "type": "git", - "url": "https://github.com/filp/whoops.git", - "reference": "d501fd2658d55491a2295ff600ae5978eaad7403" + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/d501fd2658d55491a2295ff600ae5978eaad7403", - "reference": "d501fd2658d55491a2295ff600ae5978eaad7403", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", + "reference": "ed22aee8d17c7b396f74a58b1e7fefa4f90d5ef1", "shasum": "" }, "require": { - "php": "^5.5.9 || ^7.0 || ^8.0", - "psr/log": "^1.0.1" + "php": "^7.1 || ^8.0", + "psr/container": "^1.0", + "symfony/deprecation-contracts": "^2.2" + }, + "conflict": { + "fzaninotto/faker": "*" }, "require-dev": { - "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-intl": "*", + "symfony/phpunit-bridge": "^4.4 || ^5.2" }, "suggest": { - "symfony/var-dumper": "Pretty print complex values better with var-dumper available", - "whoops/soap": "Formats errors as SOAP responses" + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-main": "v1.15-dev" } }, "autoload": { "psr-4": { - "Whoops\\": "src/Whoops/" + "Faker\\": "src/Faker/" } }, "notification-url": "https://packagist.org/downloads/", @@ -7503,16 +7570,75 @@ ], "authors": [ { - "name": "Filipe Dobreira", - "homepage": "https://github.com/filp", - "role": "Developer" + "name": "François Zaninotto" } ], - "description": "php error handling for cool kids", - "homepage": "https://filp.github.io/whoops/", + "description": "Faker is a PHP library that generates fake data for you.", "keywords": [ - "error", - "exception", + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v.1.14.1" + }, + "time": "2021-03-30T06:27:33+00:00" + }, + { + "name": "filp/whoops", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d501fd2658d55491a2295ff600ae5978eaad7403" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d501fd2658d55491a2295ff600ae5978eaad7403", + "reference": "d501fd2658d55491a2295ff600ae5978eaad7403", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0 || ^8.0", + "psr/log": "^1.0.1" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", "handling", "library", "throwable", @@ -7634,61 +7760,6 @@ ], "time": "2021-04-06T18:37:33+00:00" }, - { - "name": "fzaninotto/faker", - "version": "v1.9.2", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "reference": "848d8125239d7dbf8ab25cb7f054f1a630e68c2e", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^2.9.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "support": { - "issues": "https://github.com/fzaninotto/Faker/issues", - "source": "https://github.com/fzaninotto/Faker/tree/v1.9.2" - }, - "abandoned": true, - "time": "2020-12-11T09:56:16+00:00" - }, { "name": "hamcrest/hamcrest-php", "version": "v2.0.1", @@ -8106,35 +8177,35 @@ }, { "name": "nunomaduro/collision", - "version": "v4.3.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e" + "reference": "41b7e9999133d5082700d31a1d0977161df8322a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c125dc2463f3e144ddc7e05e63077109508c94e", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a", + "reference": "41b7e9999133d5082700d31a1d0977161df8322a", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.4", - "php": "^7.2.5 || ^8.0", + "filp/whoops": "^2.7.2", + "php": "^7.3 || ^8.0", "symfony/console": "^5.0" }, "require-dev": { - "facade/ignition": "^2.0", - "fideloper/proxy": "^4.2", - "friendsofphp/php-cs-fixer": "^2.16", - "fruitcake/laravel-cors": "^1.0", - "laravel/framework": "^7.0", - "laravel/tinker": "^2.0", - "nunomaduro/larastan": "^0.6", - "orchestra/testbench": "^5.0", - "phpstan/phpstan": "^0.12.3", - "phpunit/phpunit": "^8.5.1 || ^9.0" + "brianium/paratest": "^6.1", + "fideloper/proxy": "^4.4.1", + "friendsofphp/php-cs-fixer": "^2.17.3", + "fruitcake/laravel-cors": "^2.0.3", + "laravel/framework": "^9.0", + "nunomaduro/larastan": "^0.6.2", + "nunomaduro/mock-final-classes": "^1.0", + "orchestra/testbench": "^7.0", + "phpstan/phpstan": "^0.12.64", + "phpunit/phpunit": "^9.5.0" }, "type": "library", "extra": { @@ -8190,55 +8261,60 @@ "type": "patreon" } ], - "time": "2020-10-29T15:12:23+00:00" + "time": "2021-04-09T13:38:32+00:00" }, { "name": "nunomaduro/phpinsights", - "version": "v1.14.1", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/nunomaduro/phpinsights.git", - "reference": "d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf" + "reference": "33aa038187a7e79e9a28f82cdb4541fd2b64c366" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf", - "reference": "d8204dc1c30e5f0fe725b29eac1b5ea2202a7fcf", + "url": "https://api.github.com/repos/nunomaduro/phpinsights/zipball/33aa038187a7e79e9a28f82cdb4541fd2b64c366", + "reference": "33aa038187a7e79e9a28f82cdb4541fd2b64c366", "shasum": "" }, "require": { - "composer/composer": "^1.7", + "composer/composer": "^1.7 || ^2.0", "ext-iconv": "*", "ext-json": "*", "ext-mbstring": "*", "ext-tokenizer": "*", - "friendsofphp/php-cs-fixer": "^2.15", + "friendsofphp/php-cs-fixer": "^2.16.1", "justinrainbow/json-schema": "^5.1", "league/container": "^3.2", "object-calisthenics/phpcs-calisthenics-rules": "^3.7", - "php": "^7.2", - "phploc/phploc": "^5.0|^6.0", + "php": "^7.4 || ^8.0", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phploc/phploc": "^5.0|^6.0|^7.0", "psr/container": "^1.0", + "psr/simple-cache": "^1.0", "slevomat/coding-standard": "^6.0", - "squizlabs/php_codesniffer": "^3.4", + "squizlabs/php_codesniffer": "^3.5", + "symfony/cache": "^4.4|^5.0", "symfony/console": "^4.2|^5.0", "symfony/finder": "^4.2|^5.0", "symfony/http-client": "^4.3|^5.0" }, "require-dev": { - "ergebnis/phpstan-rules": "^0.14.0", - "illuminate/console": "^5.8|^6.0|^7.0", - "illuminate/support": "^5.8|^6.0|^7.0", + "ergebnis/phpstan-rules": "^0.15.0", + "illuminate/console": "^5.8|^6.0|^7.0|^8.0", + "illuminate/support": "^5.8|^6.0|^7.0|^8.0", "mockery/mockery": "^1.0", "phpstan/phpstan-strict-rules": "^0.12", "phpunit/phpunit": "^8.0|^9.0", + "rector/rector-prefixed": "^0.9.19", "symfony/var-dumper": "^4.2|^5.0", - "symplify/easy-coding-standard": "^7.1", + "symplify/easy-coding-standard": "^9.1", "thecodingmachine/phpstan-strict-rules": "^0.12.0" }, "suggest": { "ext-simplexml": "It is needed for the checkstyle formatter" }, + "default-branch": true, "bin": [ "bin/phpinsights" ], @@ -8276,7 +8352,7 @@ ], "support": { "issues": "https://github.com/nunomaduro/phpinsights/issues", - "source": "https://github.com/nunomaduro/phpinsights/tree/v1.14.1" + "source": "https://github.com/nunomaduro/phpinsights/tree/master" }, "funding": [ { @@ -8296,7 +8372,7 @@ "type": "patreon" } ], - "time": "2021-01-27T19:08:59+00:00" + "time": "2021-04-17T10:51:18+00:00" }, { "name": "object-calisthenics/phpcs-calisthenics-rules", @@ -8514,6 +8590,63 @@ }, "time": "2020-10-14T08:39:05+00:00" }, + { + "name": "php-parallel-lint/php-parallel-lint", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-parallel-lint/PHP-Parallel-Lint.git", + "reference": "772a954e5f119f6f5871d015b23eabed8cbdadfb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-parallel-lint/PHP-Parallel-Lint/zipball/772a954e5f119f6f5871d015b23eabed8cbdadfb", + "reference": "772a954e5f119f6f5871d015b23eabed8cbdadfb", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": ">=5.3.0" + }, + "replace": { + "grogy/php-parallel-lint": "*", + "jakub-onderka/php-parallel-lint": "*" + }, + "require-dev": { + "nette/tester": "^1.3 || ^2.0", + "php-parallel-lint/php-console-highlighter": "~0.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "php-parallel-lint/php-console-highlighter": "Highlight syntax in code snippet" + }, + "bin": [ + "parallel-lint" + ], + "type": "library", + "autoload": { + "classmap": [ + "./" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Jakub Onderka", + "email": "ahoj@jakubonderka.cz" + } + ], + "description": "This tool check syntax of PHP files about 20x faster than serial check.", + "homepage": "https://github.com/php-parallel-lint/PHP-Parallel-Lint", + "support": { + "issues": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/issues", + "source": "https://github.com/php-parallel-lint/PHP-Parallel-Lint/tree/v1.3.0" + }, + "time": "2021-04-07T14:42:48+00:00" + }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -8674,25 +8807,25 @@ }, { "name": "phploc/phploc", - "version": "6.0.2", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phploc.git", - "reference": "00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29" + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29", - "reference": "00e3bade7b22a6f23b17c3bf2fa4dba24ead8a29", + "url": "https://api.github.com/repos/sebastianbergmann/phploc/zipball/af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", + "reference": "af0d5fc84f3f7725513ba59cdcbe670ac2a4532a", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "php": "^7.3", - "sebastian/finder-facade": "^2.0", - "sebastian/version": "^3.0", - "symfony/console": "^4.0 || ^5.0" + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0", + "sebastian/cli-parser": "^1.0", + "sebastian/version": "^3.0" }, "bin": [ "phploc" @@ -8700,7 +8833,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "7.0-dev" } }, "autoload": { @@ -8723,9 +8856,15 @@ "homepage": "https://github.com/sebastianbergmann/phploc", "support": { "issues": "https://github.com/sebastianbergmann/phploc/issues", - "source": "https://github.com/sebastianbergmann/phploc/tree/6.0.2" + "source": "https://github.com/sebastianbergmann/phploc/tree/7.0.2" }, - "time": "2020-02-28T05:42:22+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-12-07T05:51:20+00:00" }, { "name": "phpspec/prophecy", @@ -9268,6 +9407,105 @@ ], "time": "2021-03-23T07:16:29+00:00" }, + { + "name": "psr/cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", + "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/master" + }, + "time": "2016-08-06T20:24:11+00:00" + }, + { + "name": "react/promise", + "version": "v2.8.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v2.8.0" + }, + "time": "2020-05-12T15:16:56+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", @@ -9772,57 +10010,6 @@ ], "time": "2020-09-28T05:24:23+00:00" }, - { - "name": "sebastian/finder-facade", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/finder-facade.git", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "reference": "9d3e74b845a2ce50e19b25b5f0c2718e153bee6c", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "php": "^7.3", - "symfony/finder": "^4.1|^5.0", - "theseer/fdomdocument": "^1.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FinderFacade is a convenience wrapper for Symfony's Finder component.", - "homepage": "https://github.com/sebastianbergmann/finder-facade", - "support": { - "issues": "https://github.com/sebastianbergmann/finder-facade/issues", - "source": "https://github.com/sebastianbergmann/finder-facade/tree/2.0.0" - }, - "abandoned": true, - "time": "2020-02-08T06:07:58+00:00" - }, { "name": "sebastian/global-state", "version": "5.0.2", @@ -10511,6 +10698,180 @@ }, "time": "2021-04-09T00:54:41+00:00" }, + { + "name": "symfony/cache", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache.git", + "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache/zipball/093d69bb10c959553c8beb828b8d4ea250a247dd", + "reference": "093d69bb10c959553c8beb828b8d4ea250a247dd", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0|^2.0", + "psr/log": "^1.1", + "symfony/cache-contracts": "^1.1.7|^2", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "conflict": { + "doctrine/dbal": "<2.10", + "symfony/dependency-injection": "<4.4", + "symfony/http-kernel": "<4.4", + "symfony/var-dumper": "<4.4" + }, + "provide": { + "psr/cache-implementation": "1.0|2.0", + "psr/simple-cache-implementation": "1.0", + "symfony/cache-implementation": "1.0|2.0" + }, + "require-dev": { + "cache/integration-tests": "dev-master", + "doctrine/cache": "^1.6", + "doctrine/dbal": "^2.10|^3.0", + "predis/predis": "^1.1", + "psr/simple-cache": "^1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/filesystem": "^4.4|^5.0", + "symfony/http-kernel": "^4.4|^5.0", + "symfony/messenger": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Cache\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an extended PSR-6, PSR-16 (and tags) implementation", + "homepage": "https://symfony.com", + "keywords": [ + "caching", + "psr6" + ], + "support": { + "source": "https://github.com/symfony/cache/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-16T09:10:13+00:00" + }, + { + "name": "symfony/cache-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/cache-contracts.git", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/cache": "^1.0" + }, + "suggest": { + "symfony/cache-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Cache\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to caching", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/cache-contracts/tree/v2.2.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, { "name": "symfony/filesystem", "version": "v5.2.6", @@ -10859,48 +11220,77 @@ "time": "2021-01-27T10:15:41+00:00" }, { - "name": "theseer/fdomdocument", - "version": "1.6.6", + "name": "symfony/var-exporter", + "version": "v5.2.4", "source": { "type": "git", - "url": "https://github.com/theseer/fDOMDocument.git", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca" + "url": "https://github.com/symfony/var-exporter.git", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/fDOMDocument/zipball/6e8203e40a32a9c770bcb62fe37e68b948da6dca", - "reference": "6e8203e40a32a9c770bcb62fe37e68b948da6dca", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/5aed4875ab514c8cb9b6ff4772baa25fa4c10307", + "reference": "5aed4875ab514c8cb9b6ff4772baa25fa4c10307", "shasum": "" }, "require": { - "ext-dom": "*", - "lib-libxml": "*", - "php": ">=5.3.3" + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "require-dev": { + "symfony/var-dumper": "^4.4.9|^5.0.9" }, "type": "library", "autoload": { - "classmap": [ - "src/" + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "lead" + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], - "description": "The classes contained within this repository extend the standard DOM to use exceptions at all occasions of errors instead of PHP warnings or notices. They also add various custom methods and shortcuts for convenience and to simplify the usage of DOM.", - "homepage": "https://github.com/theseer/fDOMDocument", + "description": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "serialize" + ], "support": { - "issues": "https://github.com/theseer/fDOMDocument/issues", - "source": "https://github.com/theseer/fDOMDocument/tree/master" + "source": "https://github.com/symfony/var-exporter/tree/v5.2.4" }, - "time": "2017-06-30T11:53:12+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-27T10:01:46+00:00" }, { "name": "theseer/tokenizer", @@ -10951,73 +11341,18 @@ } ], "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], "minimum-stability": "RC", - "stability-flags": [], + "stability-flags": { + "tymon/jwt-auth": 20, + "nunomaduro/phpinsights": 20 + }, "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4", + "php": "^8.0", "ext-bcmath": "*", "ext-json": "*", "ext-pcntl": "*", diff --git a/modular-structure/config/app.php b/modular-structure/config/app.php index 5a6d09d..5e1a1fd 100644 --- a/modular-structure/config/app.php +++ b/modular-structure/config/app.php @@ -22,7 +22,7 @@ | | This value determines the "environment" your application is currently | running in. This may determine how you prefer to configure various - | services your application utilizes. Set this in your ".env" file. + | services the application utilizes. Set this in your ".env" file. | */ @@ -39,7 +39,7 @@ | */ - 'debug' => env('APP_DEBUG', false), + 'debug' => (bool) env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- @@ -53,6 +53,9 @@ */ 'url' => env('APP_URL', 'http://localhost'), + 'spa_url' => env('SPA_URL', 'http://localhost:3000'), + + 'asset_url' => env('ASSET_URL', null), 'support_url' => env('SUPPORT_URL', 'http://localhost'), 'support_email' => env('SUPPORT_EMAIL', 'support@example.com'), @@ -86,7 +89,7 @@ 'locales' => [ 'pt_BR' => 'Português', - 'en_US' => 'English', + 'en_US' => 'English' ], /* @@ -180,6 +183,7 @@ App\Domain\Audits\Providers\DomainServiceProvider::class, App\Domain\Users\Providers\DomainServiceProvider::class, App\Domain\Notifications\Providers\DomainServiceProvider::class, + ], /* @@ -195,39 +199,43 @@ 'aliases' => [ - 'App' => Illuminate\Support\Facades\App::class, - 'Artisan' => Illuminate\Support\Facades\Artisan::class, - 'Auth' => Illuminate\Support\Facades\Auth::class, - 'Blade' => Illuminate\Support\Facades\Blade::class, - 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, - 'Bus' => Illuminate\Support\Facades\Bus::class, - 'Cache' => Illuminate\Support\Facades\Cache::class, - 'Config' => Illuminate\Support\Facades\Config::class, - 'Cookie' => Illuminate\Support\Facades\Cookie::class, - 'Crypt' => Illuminate\Support\Facades\Crypt::class, - 'DB' => Illuminate\Support\Facades\DB::class, - 'Eloquent' => Illuminate\Database\Eloquent\Model::class, - 'Event' => Illuminate\Support\Facades\Event::class, - 'File' => Illuminate\Support\Facades\File::class, - 'Gate' => Illuminate\Support\Facades\Gate::class, - 'Hash' => Illuminate\Support\Facades\Hash::class, - 'Lang' => Illuminate\Support\Facades\Lang::class, - 'Log' => Illuminate\Support\Facades\Log::class, - 'Mail' => Illuminate\Support\Facades\Mail::class, + 'App' => Illuminate\Support\Facades\App::class, + 'Arr' => Illuminate\Support\Arr::class, + 'Artisan' => Illuminate\Support\Facades\Artisan::class, + 'Auth' => Illuminate\Support\Facades\Auth::class, + 'Blade' => Illuminate\Support\Facades\Blade::class, + 'Broadcast' => Illuminate\Support\Facades\Broadcast::class, + 'Bus' => Illuminate\Support\Facades\Bus::class, + 'Cache' => Illuminate\Support\Facades\Cache::class, + 'Config' => Illuminate\Support\Facades\Config::class, + 'Cookie' => Illuminate\Support\Facades\Cookie::class, + 'Crypt' => Illuminate\Support\Facades\Crypt::class, + 'Date' => Illuminate\Support\Facades\Date::class, + 'DB' => Illuminate\Support\Facades\DB::class, + 'Eloquent' => Illuminate\Database\Eloquent\Model::class, + 'Event' => Illuminate\Support\Facades\Event::class, + '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, 'Notification' => Illuminate\Support\Facades\Notification::class, - 'Password' => Illuminate\Support\Facades\Password::class, - 'Queue' => Illuminate\Support\Facades\Queue::class, - 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::class, - 'Request' => Illuminate\Support\Facades\Request::class, - 'Response' => Illuminate\Support\Facades\Response::class, - 'Route' => Illuminate\Support\Facades\Route::class, - 'Schema' => Illuminate\Support\Facades\Schema::class, - 'Session' => Illuminate\Support\Facades\Session::class, - 'Storage' => Illuminate\Support\Facades\Storage::class, - 'URL' => Illuminate\Support\Facades\URL::class, - 'Validator' => Illuminate\Support\Facades\Validator::class, - 'View' => Illuminate\Support\Facades\View::class, + 'Password' => Illuminate\Support\Facades\Password::class, + 'Queue' => Illuminate\Support\Facades\Queue::class, + 'Redirect' => Illuminate\Support\Facades\Redirect::class, + // 'Redis' => Illuminate\Support\Facades\Redis::class, + 'Request' => Illuminate\Support\Facades\Request::class, + 'Response' => Illuminate\Support\Facades\Response::class, + 'Route' => Illuminate\Support\Facades\Route::class, + 'Schema' => Illuminate\Support\Facades\Schema::class, + 'Session' => Illuminate\Support\Facades\Session::class, + 'Storage' => Illuminate\Support\Facades\Storage::class, + 'Str' => Illuminate\Support\Str::class, + 'URL' => Illuminate\Support\Facades\URL::class, + 'Validator' => Illuminate\Support\Facades\Validator::class, + 'View' => Illuminate\Support\Facades\View::class, ], diff --git a/modular-structure/config/audit.php b/modular-structure/config/audit.php index a90207b..6bf601a 100644 --- a/modular-structure/config/audit.php +++ b/modular-structure/config/audit.php @@ -12,6 +12,9 @@ * please view the LICENSE.md file that was distributed * with this source code. */ + +use App\Domain\Audits\Entities\Audit; + return [ /* @@ -23,7 +26,7 @@ | */ - 'implementation' => App\Domain\Audits\Entities\Audit::class, + 'implementation' => Audit::class, /* |-------------------------------------------------------------------------- diff --git a/modular-structure/config/auth.php b/modular-structure/config/auth.php index e3e8b31..ef41c56 100644 --- a/modular-structure/config/auth.php +++ b/modular-structure/config/auth.php @@ -1,5 +1,7 @@ [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\Domain\Users\Entities\User::class, + 'model' => User::class, ], // 'users' => [ diff --git a/modular-structure/config/broadcasting.php b/modular-structure/config/broadcasting.php index 77e910d..2d52982 100644 --- a/modular-structure/config/broadcasting.php +++ b/modular-structure/config/broadcasting.php @@ -11,11 +11,11 @@ | framework when an event needs to be broadcast. You may set this to | any of the connections defined in the "connections" array below. | - | Supported: "pusher", "redis", "log", "null" + | Supported: "pusher", "ably", "redis", "log", "null" | */ - 'default' => env('BROADCAST_DRIVER', 'pusher'), + 'default' => env('BROADCAST_DRIVER', 'null'), /* |-------------------------------------------------------------------------- @@ -31,18 +31,34 @@ 'connections' => [ 'pusher' => [ - 'driver' => 'pusher', - 'key' => env('PUSHER_APP_KEY'), - 'secret' => env('PUSHER_APP_SECRET'), - 'app_id' => env('PUSHER_APP_ID'), + 'driver' => 'pusher', + 'key' => env('PUSHER_APP_KEY'), + 'secret' => env('PUSHER_APP_SECRET'), + 'app_id' => env('PUSHER_APP_ID'), 'options' => [ - 'host' => env('PUSHER_APP_HOST', '127.0.0.1'), - 'port' => 6001, - 'scheme' => 'http', - 'encrypted' => false, + 'cluster' => env('PUSHER_APP_CLUSTER'), + 'useTLS' => true, ], ], + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + + 'redis' => [ + 'driver' => 'redis', + 'connection' => 'default', + ], + + 'log' => [ + 'driver' => 'log', + ], + + 'null' => [ + 'driver' => 'null', + ], + ], ]; diff --git a/modular-structure/config/cache.php b/modular-structure/config/cache.php index d0e7248..e32a2fd 100644 --- a/modular-structure/config/cache.php +++ b/modular-structure/config/cache.php @@ -13,9 +13,6 @@ | using this caching library. This connection is used when another is | not explicitly specified when executing a given caching function. | - | Supported: "apc", "array", "database", "file", - | "memcached", "redis", "dynamodb" - | */ 'default' => env('CACHE_DRIVER', 'file'), @@ -29,6 +26,9 @@ | well as their drivers. You may even define multiple stores for the | same cache driver to group types of items stored in your caches. | + | Supported drivers: "apc", "array", "database", "file", + | "memcached", "redis", "dynamodb", "null" + | */ 'stores' => [ @@ -39,49 +39,52 @@ 'array' => [ 'driver' => 'array', + 'serialize' => false, ], 'database' => [ - 'driver' => 'database', - 'table' => 'cache', + 'driver' => 'database', + 'table' => 'cache', 'connection' => null, + 'lock_connection' => null, ], 'file' => [ 'driver' => 'file', - 'path' => storage_path('framework/cache/data'), + 'path' => storage_path('framework/cache/data'), ], 'memcached' => [ - 'driver' => 'memcached', + 'driver' => 'memcached', 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), - 'sasl' => [ + 'sasl' => [ env('MEMCACHED_USERNAME'), env('MEMCACHED_PASSWORD'), ], - 'options' => [ + 'options' => [ // Memcached::OPT_CONNECT_TIMEOUT => 2000, ], - 'servers' => [ + 'servers' => [ [ - 'host' => env('MEMCACHED_HOST', '127.0.0.1'), - 'port' => env('MEMCACHED_PORT', 11211), + 'host' => env('MEMCACHED_HOST', '127.0.0.1'), + 'port' => env('MEMCACHED_PORT', 11211), 'weight' => 100, ], ], ], 'redis' => [ - 'driver' => 'redis', + 'driver' => 'redis', 'connection' => 'cache', + 'lock_connection' => 'default', ], 'dynamodb' => [ - 'driver' => 'dynamodb', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), - 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'driver' => 'dynamodb', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 'endpoint' => env('DYNAMODB_ENDPOINT'), ], @@ -98,6 +101,6 @@ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache'), + 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'), ]; diff --git a/modular-structure/config/cors.php b/modular-structure/config/cors.php new file mode 100644 index 0000000..7dbe8bb --- /dev/null +++ b/modular-structure/config/cors.php @@ -0,0 +1,45 @@ + [ + 'api/*', + 'login', + 'logout', + 'register', + 'user/password', + 'forgot-password', + 'reset-password', + 'sanctum/csrf-cookie', + 'user/profile-information', + 'email/verification-notification', + ], + + 'allowed_methods' => ['*'], + + 'allowed_origins' => ['*'], + + 'allowed_origins_patterns' => [], + + 'allowed_headers' => ['*'], + + 'exposed_headers' => [], + + 'max_age' => 0, + + 'supports_credentials' => true, + +]; diff --git a/modular-structure/config/database.php b/modular-structure/config/database.php index a9ebf4d..e09f75e 100644 --- a/modular-structure/config/database.php +++ b/modular-structure/config/database.php @@ -36,58 +36,58 @@ 'connections' => [ 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('DATABASE_URL'), - 'database' => env('DB_DATABASE', database_path('database.sqlite')), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('DATABASE_URL'), + 'database' => env('DB_DATABASE', database_path('database.sqlite')), + 'prefix' => '', 'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true), ], 'mysql' => [ - 'driver' => 'mysql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '3306'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'unix_socket' => env('DB_SOCKET', ''), - 'charset' => 'utf8mb4', - 'collation' => 'utf8mb4_unicode_ci', - 'prefix' => '', + 'driver' => 'mysql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '3306'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'unix_socket' => env('DB_SOCKET', ''), + 'charset' => 'utf8mb4', + 'collation' => 'utf8mb4_unicode_ci', + 'prefix' => '', 'prefix_indexes' => true, - 'strict' => true, - 'engine' => null, - 'options' => extension_loaded('pdo_mysql') ? array_filter([ + 'strict' => true, + 'engine' => null, + 'options' => extension_loaded('pdo_mysql') ? array_filter([ PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'), ]) : [], ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', '127.0.0.1'), - 'port' => env('DB_PORT', '5432'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', '127.0.0.1'), + 'port' => env('DB_PORT', '5432'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('DATABASE_URL'), - 'host' => env('DB_HOST', 'localhost'), - 'port' => env('DB_PORT', '1433'), - 'database' => env('DB_DATABASE', 'forge'), - 'username' => env('DB_USERNAME', 'forge'), - 'password' => env('DB_PASSWORD', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('DATABASE_URL'), + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', '1433'), + 'database' => env('DB_DATABASE', 'forge'), + 'username' => env('DB_USERNAME', 'forge'), + 'password' => env('DB_PASSWORD', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], @@ -123,25 +123,25 @@ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'), ], 'default' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_DB', '0'), ], 'cache' => [ - 'url' => env('REDIS_URL'), - 'host' => env('REDIS_HOST', '127.0.0.1'), + 'url' => env('REDIS_URL'), + 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', '6379'), + 'port' => env('REDIS_PORT', '6379'), 'database' => env('REDIS_CACHE_DB', '1'), ], ], -]; +]; \ No newline at end of file diff --git a/modular-structure/config/filesystems.php b/modular-structure/config/filesystems.php index 5a78c8a..10c9d9b 100644 --- a/modular-structure/config/filesystems.php +++ b/modular-structure/config/filesystems.php @@ -15,19 +15,6 @@ 'default' => env('FILESYSTEM_DRIVER', 'local'), - /* - |-------------------------------------------------------------------------- - | Default Cloud Filesystem Disk - |-------------------------------------------------------------------------- - | - | Many applications store files both locally and in the cloud. For this - | reason, you may specify a default "cloud" driver here. This driver - | will be bound as the Cloud disk implementation in the container. - | - */ - - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), - /* |-------------------------------------------------------------------------- | Filesystem Disks @@ -45,35 +32,41 @@ 'local' => [ 'driver' => 'local', - 'root' => storage_path('app'), + 'root' => storage_path('app'), ], 'public' => [ - 'driver' => 'local', - 'root' => storage_path('app/public'), - 'url' => env('APP_URL') . '/storage', + 'driver' => 'local', + 'root' => storage_path('app/public'), + 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ], 's3' => [ - 'driver' => 's3', - 'key' => env('AWS_ACCESS_KEY_ID'), - 'secret' => env('AWS_SECRET_ACCESS_KEY'), - 'region' => env('AWS_DEFAULT_REGION'), - 'bucket' => env('AWS_BUCKET'), - 'url' => env('AWS_URL'), + 'driver' => 's3', + 'key' => env('AWS_ACCESS_KEY_ID'), + 'secret' => env('AWS_SECRET_ACCESS_KEY'), + 'region' => env('AWS_DEFAULT_REGION'), + 'bucket' => env('AWS_BUCKET'), + 'url' => env('AWS_URL'), 'endpoint' => env('AWS_ENDPOINT'), ], - 'gcs' => [ - 'driver' => 's3', - 'key' => env('GCS_KEY'), - 'secret' => env('GCS_SECRET'), - 'region' => env('GCS_REGION'), - 'bucket' => env('GCS_BUCKET'), - 'endpoint' => 'https://storage.googleapis.com', - ], + ], + + /* + |-------------------------------------------------------------------------- + | 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/modular-structure/config/geoip.php b/modular-structure/config/geoip.php new file mode 100644 index 0000000..695ec0b --- /dev/null +++ b/modular-structure/config/geoip.php @@ -0,0 +1,173 @@ + true, + + /* + |-------------------------------------------------------------------------- + | Include Currency in Results + |-------------------------------------------------------------------------- + | + | When enabled the system will do it's best in deciding the user's currency + | by matching their ISO code to a preset list of currencies. + | + */ + + 'include_currency' => true, + + /* + |-------------------------------------------------------------------------- + | Default Service + |-------------------------------------------------------------------------- + | + | Here you may specify the default storage driver that should be used + | by the framework. + | + | Supported: "maxmind_database", "maxmind_api", "ipapi" + | + */ + + 'service' => 'ipapi', + + /* + |-------------------------------------------------------------------------- + | Storage Specific Configuration + |-------------------------------------------------------------------------- + | + | Here you may configure as many storage drivers as you wish. + | + */ + + 'services' => [ + + 'maxmind_database' => [ + 'class' => MaxMindDatabase::class, + 'database_path' => storage_path('app/geoip.mmdb'), + 'update_url' => sprintf('https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=%s&suffix=tar.gz', + env('MAXMIND_LICENSE_KEY')), + 'locales' => ['en'], + ], + + 'maxmind_api' => [ + 'class' => MaxMindWebService::class, + 'user_id' => env('MAXMIND_USER_ID'), + 'license_key' => env('MAXMIND_LICENSE_KEY'), + 'locales' => ['en'], + ], + + 'ipapi' => [ + 'class' => IPApi::class, + 'secure' => true, + 'key' => env('IPAPI_KEY'), + 'continent_path' => storage_path('app/continents.json'), + 'lang' => 'en', + ], + + 'ipgeolocation' => [ + 'class' => IPGeoLocation::class, + 'secure' => true, + 'key' => env('IPGEOLOCATION_KEY'), + 'continent_path' => storage_path('app/continents.json'), + 'lang' => 'en', + ], + + 'ipdata' => [ + 'class' => IPData::class, + 'key' => env('IPDATA_API_KEY'), + 'secure' => true, + ], + + 'ipfinder' => [ + 'class' => IPFinder::class, + 'key' => env('IPFINDER_API_KEY'), + 'secure' => true, + 'locales' => ['en'], + ], + + ], + + /* + |-------------------------------------------------------------------------- + | Default Cache Driver + |-------------------------------------------------------------------------- + | + | Here you may specify the type of caching that should be used + | by the package. + | + | Options: + | + | all - All location are cached + | some - Cache only the requesting user + | none - Disable cached + | + */ + + 'cache' => 'all', + + /* + |-------------------------------------------------------------------------- + | Cache Tags + |-------------------------------------------------------------------------- + | + | Cache tags are not supported when using the file or database cache + | drivers in Laravel. This is done so that only locations can be cleared. + | + */ + + 'cache_tags' => ['torann-geoip-location'], + + /* + |-------------------------------------------------------------------------- + | Cache Expiration + |-------------------------------------------------------------------------- + | + | Define how long cached location are valid. + | + */ + + 'cache_expires' => 30, + + /* + |-------------------------------------------------------------------------- + | Default Location + |-------------------------------------------------------------------------- + | + | Return when a location is not found. + | + */ + + 'default_location' => [ + 'ip' => '127.0.0.0', + 'iso_code' => 'US', + 'country' => 'United States', + 'city' => 'New Haven', + 'state' => 'CT', + 'state_name' => 'Connecticut', + 'postal_code' => '06510', + 'lat' => 41.31, + 'lon' => -72.92, + 'timezone' => 'America/New_York', + 'continent' => 'NA', + 'default' => true, + 'currency' => 'USD', + ], + +]; diff --git a/modular-structure/config/horizon.php b/modular-structure/config/horizon.php index e14e359..605882f 100644 --- a/modular-structure/config/horizon.php +++ b/modular-structure/config/horizon.php @@ -1,5 +1,7 @@ env('HORIZON_PREFIX', 'horizon:'), + 'prefix' => env( + 'HORIZON_PREFIX', + Str::slug(env('APP_NAME', 'laravel'), '_') . '_horizon:' + ), /* |-------------------------------------------------------------------------- @@ -65,7 +70,7 @@ | */ - 'middleware' => ['auth:api'], + 'middleware' => ['web'], /* |-------------------------------------------------------------------------- @@ -79,8 +84,7 @@ */ 'waits' => [ - 'redis:default' => 60, - 'redis:notifications' => 60, + 'redis:default' => 60, ], /* @@ -95,9 +99,30 @@ */ 'trim' => [ - 'recent' => 60, - 'failed' => 10080, - 'monitored' => 10080, + 'recent' => 60, + 'pending' => 60, + 'completed' => 60, + 'recent_failed' => 10080, + 'failed' => 10080, + 'monitored' => 10080, + ], + + /* + |-------------------------------------------------------------------------- + | Metrics + |-------------------------------------------------------------------------- + | + | Here you can configure how many snapshots should be kept to display in + | the metrics graph. This will get used in combination with Horizon's + | `horizon:snapshot` schedule to define how long to retain metrics. + | + */ + + 'metrics' => [ + 'trim_snapshots' => [ + 'job' => 24, + 'queue' => 24, + ], ], /* @@ -120,9 +145,9 @@ | Memory Limit (MB) |-------------------------------------------------------------------------- | - | This value describes the maximum amount of memory the Horizon worker - | may consume before it is terminated and restarted. You should set - | this value according to the resources available to your server. + | This value describes the maximum amount of memory the Horizon master + | supervisor may consume before it is terminated and restarted. For + | configuring these limits on your workers, see the next section. | */ @@ -139,30 +164,30 @@ | */ + 'defaults' => [ + 'supervisor-1' => [ + 'connection' => 'redis', + 'queue' => ['default', 'notifications'], + 'balance' => 'auto', + 'maxProcesses' => 1, + 'memory' => 128, + 'tries' => 1, + 'nice' => 0, + ], + ], + 'environments' => [ 'production' => [ - 'default' => [ - 'connection' => 'redis', - 'queue' => [ - 'default', - 'notifications', - ], - 'processes' => 10, - 'balance' => 'auto', - 'tries' => 3, + 'supervisor-1' => [ + 'maxProcesses' => 10, + 'balanceMaxShift' => 1, + 'balanceCooldown' => 3, ], ], 'local' => [ - 'default' => [ - 'connection' => 'redis', - 'queue' => [ - 'default', - 'notifications', - ], - 'processes' => 10, - 'balance' => 'auto', - 'tries' => 3, + 'supervisor-1' => [ + 'maxProcesses' => 3, ], ], ], diff --git a/modular-structure/config/insights.php b/modular-structure/config/insights.php index c0f6c2a..e6b91ca 100644 --- a/modular-structure/config/insights.php +++ b/modular-structure/config/insights.php @@ -70,15 +70,6 @@ '_ide_helper.php', '_ide_helper_models.php', 'public', - 'app/Domain/Audits/Database', - 'app/Domain/Companies/Database', - 'app/Domain/Notifications/Database', - 'app/Domain/Users/Database', - - 'app/Domain/Audits/Tests', - 'app/Domain/Companies/Tests', - 'app/Domain/Notifications/Tests', - 'app/Domain/Users/Tests', ], 'add' => [ diff --git a/modular-structure/config/logging.php b/modular-structure/config/logging.php index 088c204..1aa06aa 100644 --- a/modular-structure/config/logging.php +++ b/modular-structure/config/logging.php @@ -44,13 +44,13 @@ 'single' => [ 'driver' => 'single', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, ], @@ -59,12 +59,12 @@ 'url' => env('LOG_SLACK_WEBHOOK_URL'), 'username' => 'Laravel Log', 'emoji' => ':boom:', - 'level' => 'critical', + 'level' => env('LOG_LEVEL', 'critical'), ], 'papertrail' => [ 'driver' => 'monolog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => SyslogUdpHandler::class, 'handler_with' => [ 'host' => env('PAPERTRAIL_URL'), @@ -74,6 +74,7 @@ 'stderr' => [ 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ @@ -83,12 +84,12 @@ 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'null' => [ diff --git a/modular-structure/config/permission.php b/modular-structure/config/permission.php index 2a144d5..d41ecd9 100644 --- a/modular-structure/config/permission.php +++ b/modular-structure/config/permission.php @@ -1,5 +1,8 @@ [ @@ -13,7 +16,7 @@ * `Spatie\Permission\Contracts\Permission` contract. */ - 'permission' => \App\Domain\Users\Entities\Permission::class, + 'permission' => Permission::class, /* * When using the "HasRoles" trait from this package, we need to know which @@ -24,7 +27,7 @@ * `Spatie\Permission\Contracts\Role` contract. */ - 'role' => \App\Domain\Users\Entities\Role::class, + 'role' => Role::class, ], @@ -112,7 +115,7 @@ * instance to the check, this key determines what attribute on the * Permissions model is used to cache against. * - * Ideally, this should match your modular-structure way of checking permissions, eg: + * Ideally, this should match your preferred way of checking permissions, eg: * `$user->can('view-posts')` would be 'name'. */ diff --git a/modular-structure/config/queue.php b/modular-structure/config/queue.php index 3a30d6c..63b57c2 100644 --- a/modular-structure/config/queue.php +++ b/modular-structure/config/queue.php @@ -39,6 +39,7 @@ 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, + 'after_commit' => false, ], 'beanstalkd' => [ @@ -47,6 +48,7 @@ 'queue' => 'default', 'retry_after' => 90, 'block_for' => 0, + 'after_commit' => false, ], 'sqs' => [ @@ -54,8 +56,10 @@ 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), - 'queue' => env('SQS_QUEUE', 'your-queue-name'), + 'queue' => env('SQS_QUEUE', 'default'), + 'suffix' => env('SQS_SUFFIX'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, ], 'redis' => [ @@ -64,6 +68,7 @@ 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, 'block_for' => null, + 'after_commit' => false, ], ], @@ -80,9 +85,9 @@ */ 'failed' => [ - 'driver' => env('QUEUE_FAILED_DRIVER', 'database'), + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], -]; +]; \ No newline at end of file diff --git a/modular-structure/config/services.php b/modular-structure/config/services.php index e2640c9..1468851 100644 --- a/modular-structure/config/services.php +++ b/modular-structure/config/services.php @@ -17,8 +17,8 @@ 'SLACK_WEBHOOK_URL' => env('SLACK_WEBHOOK_URL'), 'mailgun' => [ - 'domain' => env('MAILGUN_DOMAIN'), - 'secret' => env('MAILGUN_SECRET'), + 'domain' => env('MAILGUN_DOMAIN'), + 'secret' => env('MAILGUN_SECRET'), 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), ], @@ -27,7 +27,7 @@ ], 'ses' => [ - 'key' => env('AWS_ACCESS_KEY_ID'), + 'key' => env('AWS_ACCESS_KEY_ID'), 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], diff --git a/modular-structure/config/session.php b/modular-structure/config/session.php index 3e9082d..4e0f66c 100644 --- a/modular-structure/config/session.php +++ b/modular-structure/config/session.php @@ -92,10 +92,12 @@ | Session Cache Store |-------------------------------------------------------------------------- | - | When using the "apc", "memcached", or "dynamodb" session drivers you may + | While using one of the framework's cache driven session backends you may | list a cache store that should be used for these sessions. This value | must match with one of the application's configured cache "stores". | + | Affects: "apc", "dynamodb", "memcached", "redis" + | */ 'store' => env('SESSION_STORE', null), @@ -166,7 +168,7 @@ | */ - 'secure' => env('SESSION_SECURE_COOKIE', null), + 'secure' => env('SESSION_SECURE_COOKIE'), /* |-------------------------------------------------------------------------- @@ -188,12 +190,12 @@ | | This option determines how your cookies behave when cross-site requests | 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. + | will set this value to "lax" since this is a secure default value. | - | Supported: "lax", "strict", "none" + | Supported: "lax", "strict", "none", null | */ - 'same_site' => null, + 'same_site' => 'lax', ]; diff --git a/modular-structure/database/migrations/2021_04_18_010240_add_uuid_to_failed_jobs_table.php b/modular-structure/database/migrations/2021_04_18_010240_add_uuid_to_failed_jobs_table.php new file mode 100644 index 0000000..7975ad4 --- /dev/null +++ b/modular-structure/database/migrations/2021_04_18_010240_add_uuid_to_failed_jobs_table.php @@ -0,0 +1,32 @@ +string('uuid')->after('id')->nullable()->unique(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('failed_jobs', function (Blueprint $table) { + $table->dropColumn('uuid'); + }); + } +} diff --git a/modular-structure/database/seeds/DatabaseSeeder.php b/modular-structure/database/seeders/DatabaseSeeder.php similarity index 82% rename from modular-structure/database/seeds/DatabaseSeeder.php rename to modular-structure/database/seeders/DatabaseSeeder.php index 482cfc3..2d36b57 100644 --- a/modular-structure/database/seeds/DatabaseSeeder.php +++ b/modular-structure/database/seeders/DatabaseSeeder.php @@ -1,7 +1,8 @@ call(CompaniesTableSeed::class); $this->call(PermissionsTableSeeder::class); $this->call(RolesTableSeeder::class); $this->call(UsersTableSeed::class); diff --git a/modular-structure/docker-compose.develop.yml b/modular-structure/docker-compose.develop.yml index 8f31930..7a0b862 100644 --- a/modular-structure/docker-compose.develop.yml +++ b/modular-structure/docker-compose.develop.yml @@ -78,9 +78,9 @@ services: ports: - 5432:5432 environment: - POSTGRES_DB: default - POSTGRES_USER: default - POSTGRES_PASSWORD: default + POSTGRES_DB: modular + POSTGRES_USER: modular + POSTGRES_PASSWORD: modular volumes: - pg-data:/var/lib/postgresql/data diff --git a/modular-structure/docker-compose.testing.yml b/modular-structure/docker-compose.testing.yml index 0e65b78..6b8ef21 100644 --- a/modular-structure/docker-compose.testing.yml +++ b/modular-structure/docker-compose.testing.yml @@ -23,19 +23,19 @@ services: - redis pgsql: - image: launcher.gcr.io/google/postgresql11 + image: launcher.gcr.io/google/postgresql13 container_name: modular-structure-pgsql-testing ports: - 5432:5432 environment: - POSTGRES_DB: default_testing - POSTGRES_USER: default_testing - POSTGRES_PASSWORD: default_testing + POSTGRES_DB: modular_testing + POSTGRES_USER: modular_testing + POSTGRES_PASSWORD: modular_testing volumes: - pg-testing-data:/var/lib/postgresql/data redis: - image: redis:5.0.5-alpine + image: library/redis:6.0.10-alpine container_name: modular-structure-redis-testing restart: always ports: @@ -45,4 +45,4 @@ services: volumes: pg-testing-data: - redis-testing-data: \ No newline at end of file + redis-testing-data: diff --git a/modular-structure/php.ini b/modular-structure/php.ini index 5b3f117..b389677 100644 --- a/modular-structure/php.ini +++ b/modular-structure/php.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,6 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so \ No newline at end of file diff --git a/modular-structure/php.testing.ini b/modular-structure/php.testing.ini index 748c074..b389677 100644 --- a/modular-structure/php.testing.ini +++ b/modular-structure/php.testing.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,7 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so -zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20190902/xdebug.so" \ No newline at end of file diff --git a/modular-structure/public/index.php b/modular-structure/public/index.php index f9ea692..02d9057 100644 --- a/modular-structure/public/index.php +++ b/modular-structure/public/index.php @@ -9,6 +9,10 @@ define('LARAVEL_START', microtime(true)); +if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { + require __DIR__.'/../storage/framework/maintenance.php'; +} + /* |-------------------------------------------------------------------------- | Register The Auto Loader From 9eaca666af6aa10b6b5ca3660b99015114a3cf6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sun, 18 Apr 2021 09:06:45 -0300 Subject: [PATCH 5/8] refactor: typed properties and typed returns --- default-structure/.env.example | 1 + default-structure/.env.testing | 1 + .../Auth/AuthorizeDeviceController.php | 5 ++- .../Auth/DisableAccountController.php | 3 +- .../Auth/EmailVerificationController.php | 3 +- .../Http/Controllers/Auth/LoginController.php | 1 - .../Controllers/Auth/RegisterController.php | 13 ++---- .../TwoFactorAuthenticationController.php | 7 ++-- .../Controllers/NotificationController.php | 9 ++-- .../app/Http/Requests/UserUpdateRequest.php | 6 +-- .../Providers/RepositoryServiceProvider.php | 2 - modular-structure/.env.example | 1 + modular-structure/.env.testing | 1 + .../Http/Middlewares/SetLocale.php | 2 +- .../Domain/Audits/Policies/AuditPolicy.php | 9 ++-- .../Providers/DomainServiceProvider.php | 10 ++--- .../Policies/NotificationPolicy.php | 9 ++-- .../Providers/DomainServiceProvider.php | 8 ++-- .../Contracts/AuthorizedDeviceRepository.php | 4 +- .../Controllers/AuthorizeDeviceController.php | 5 ++- .../Controllers/DisableAccountController.php | 3 +- .../EmailVerificationController.php | 3 +- .../Http/Controllers/LoginController.php | 4 +- .../Controllers/NotificationController.php | 10 +++-- .../Http/Controllers/RegisterController.php | 13 ++---- .../TwoFactorAuthenticationController.php | 26 ++++-------- .../Users/Http/Controllers/UserController.php | 42 +++++-------------- .../Users/Http/Controllers/UtilController.php | 3 +- .../DisableTwoFactorAuthenticationRequest.php | 8 +--- .../EnableTwoFactorAuthenticationRequest.php | 8 +--- .../Http/Requests/PasswordUpdateRequest.php | 4 +- .../Users/Http/Requests/UserUpdateRequest.php | 14 +++---- .../AccountDisabledNotification.php | 4 +- .../AuthorizeDeviceNotification.php | 9 ++-- .../PasswordChangedNotification.php | 4 +- .../SuccessfulLoginFromIpNotification.php | 7 +--- ...rAuthenticationWasDisabledNotification.php | 4 +- .../Notifications/VerifyEmailNotification.php | 9 ++-- .../Users/Policies/AuthorizedDevicePolicy.php | 36 ++++------------ .../Users/Policies/LoginHistoryPolicy.php | 31 ++++---------- .../Users/Policies/PermissionPolicy.php | 35 ++++------------ .../app/Domain/Users/Policies/RolePolicy.php | 37 ++++------------ .../app/Domain/Users/Policies/UserPolicy.php | 37 ++++------------ .../Users/Providers/DomainServiceProvider.php | 23 +++------- .../Providers/RepositoryServiceProvider.php | 4 +- .../EloquentAuthorizedDevicesRepository.php | 4 +- .../EloquentLoginHistoryRepository.php | 2 +- .../Users/Services/DisableAccountService.php | 2 +- .../Abstracts/ServiceProvider.php | 28 ++++--------- .../Http/Controllers/ResponseTrait.php | 8 ---- modular-structure/config/register.php | 1 - 51 files changed, 169 insertions(+), 354 deletions(-) diff --git a/default-structure/.env.example b/default-structure/.env.example index 3a00e22..fa0d868 100644 --- a/default-structure/.env.example +++ b/default-structure/.env.example @@ -3,6 +3,7 @@ APP_ENV=local APP_KEY=base64:g1480dNK9TleD6NNmP0l29nPS0y8aYy/r9kBtlzmMmg= APP_DEBUG=true APP_URL=http://localhost +SPA_URL=http://localhost:3000 LOG_CHANNEL=stack diff --git a/default-structure/.env.testing b/default-structure/.env.testing index a92b7ee..9d2af37 100644 --- a/default-structure/.env.testing +++ b/default-structure/.env.testing @@ -3,6 +3,7 @@ APP_ENV=testing APP_KEY=base64:g1480dNK9TleD6NNmP0l29nPS0y8aYy/r9kBtlzmMmg= APP_DEBUG=true APP_URL=http://localhost +SPA_URL=http://localhost:3000 LOG_CHANNEL=stack diff --git a/default-structure/app/Http/Controllers/Auth/AuthorizeDeviceController.php b/default-structure/app/Http/Controllers/Auth/AuthorizeDeviceController.php index c3a5726..b00bd14 100644 --- a/default-structure/app/Http/Controllers/Auth/AuthorizeDeviceController.php +++ b/default-structure/app/Http/Controllers/Auth/AuthorizeDeviceController.php @@ -5,11 +5,12 @@ use App\Http\Controllers\Controller; use App\Models\AuthorizedDevice; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class AuthorizeDeviceController extends Controller { - public function authorizeDevice(string $token) + public function authorizeDevice(string $token): JsonResponse { $authorizedDevice = AuthorizedDevice::query() ->withoutGlobalScopes() @@ -31,7 +32,7 @@ public function authorizeDevice(string $token) return $this->respondWithCustomData(['message' => $message], Response::HTTP_BAD_REQUEST); } - public function destroy(string $id) + public function destroy(string $id): JsonResponse { $model = AuthorizedDevice::findOrFail($id); diff --git a/default-structure/app/Http/Controllers/Auth/DisableAccountController.php b/default-structure/app/Http/Controllers/Auth/DisableAccountController.php index 00394ca..2b47f32 100644 --- a/default-structure/app/Http/Controllers/Auth/DisableAccountController.php +++ b/default-structure/app/Http/Controllers/Auth/DisableAccountController.php @@ -4,6 +4,7 @@ use App\Http\Controllers\Controller; use App\Services\DisableAccountService; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class DisableAccountController extends Controller @@ -15,7 +16,7 @@ public function __construct(DisableAccountService $disableAccountService) $this->disableAccountService = $disableAccountService; } - public function disable($token) + public function disable($token): JsonResponse { $response = $this->disableAccountService->handle($token); diff --git a/default-structure/app/Http/Controllers/Auth/EmailVerificationController.php b/default-structure/app/Http/Controllers/Auth/EmailVerificationController.php index 26e455d..9541e5d 100644 --- a/default-structure/app/Http/Controllers/Auth/EmailVerificationController.php +++ b/default-structure/app/Http/Controllers/Auth/EmailVerificationController.php @@ -6,11 +6,12 @@ use App\Events\EmailWasVerifiedEvent; use App\Http\Controllers\Controller; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class EmailVerificationController extends Controller { - public function verify($token) + public function verify($token): JsonResponse { try { $user = app(UserRepository::class)->findOneBy(['email_token_confirmation' => $token]); diff --git a/default-structure/app/Http/Controllers/Auth/LoginController.php b/default-structure/app/Http/Controllers/Auth/LoginController.php index 0931d61..29b0933 100644 --- a/default-structure/app/Http/Controllers/Auth/LoginController.php +++ b/default-structure/app/Http/Controllers/Auth/LoginController.php @@ -16,7 +16,6 @@ use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Notification; use Jenssegers\Agent\Agent; -use Sujip\Ipstack\Ipstack; class LoginController extends Controller { diff --git a/default-structure/app/Http/Controllers/Auth/RegisterController.php b/default-structure/app/Http/Controllers/Auth/RegisterController.php index e66ade1..d4c7bcf 100644 --- a/default-structure/app/Http/Controllers/Auth/RegisterController.php +++ b/default-structure/app/Http/Controllers/Auth/RegisterController.php @@ -6,6 +6,7 @@ use App\Http\Controllers\Controller; use App\Models\User; use App\Rules\WeakPasswordRule; +use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -32,7 +33,7 @@ class RegisterController extends Controller * * @return void */ - public function __construct() + public function __construct(private UserRepository $userRepository) { $this->middleware('guest'); } @@ -94,16 +95,10 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. - * - * @param array $data - * @return User - * @throws \Exception */ - protected function create(array $data) + protected function create(array $data): Model { - $userRepository = app(UserRepository::class); - - return $userRepository->store([ + return $this->userRepository->store([ 'email' => $data['email'], 'name' => $data['name'], 'email_token_confirmation' => Uuid::uuid4()->toString(), diff --git a/default-structure/app/Http/Controllers/Auth/TwoFactorAuthenticationController.php b/default-structure/app/Http/Controllers/Auth/TwoFactorAuthenticationController.php index 514ac5a..bcf6cf1 100644 --- a/default-structure/app/Http/Controllers/Auth/TwoFactorAuthenticationController.php +++ b/default-structure/app/Http/Controllers/Auth/TwoFactorAuthenticationController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers\Auth; -use App\Contracts\ProfileRepository; use App\Events\TwoFactorAuthenticationWasDisabled; use App\Http\Controllers\Controller; use App\Http\Requests\DisableTwoFactorAuthenticationRequest; @@ -29,7 +28,7 @@ public function generate2faSecret(Request $request) { $twoFactorAuthentication = new TwoFactorAuthenticator($request); - $user = auth()->user(); + $user = $request->user(); $user->google2fa_enable = false; $user->google2fa_secret = $twoFactorAuthentication->generateSecretKey(32); @@ -59,7 +58,7 @@ public function enable2fa(EnableTwoFactorAuthenticationRequest $request) $twoFactorAuthentication = new TwoFactorAuthenticator($request); $secret = $request->input('one_time_password'); - $user = auth()->user(); + $user = $request->user(); try { $valid = $twoFactorAuthentication->verifyKey($user->google2fa_secret, $secret); @@ -95,7 +94,7 @@ public function enable2fa(EnableTwoFactorAuthenticationRequest $request) */ public function disable2fa(DisableTwoFactorAuthenticationRequest $request) { - $user = auth()->user(); + $user = $request->user(); if (!Hash::check($request->get('password'), $user->password)) { return $this->respondWithCustomData( diff --git a/default-structure/app/Http/Controllers/NotificationController.php b/default-structure/app/Http/Controllers/NotificationController.php index 5e635f0..21fef19 100644 --- a/default-structure/app/Http/Controllers/NotificationController.php +++ b/default-structure/app/Http/Controllers/NotificationController.php @@ -3,14 +3,15 @@ namespace App\Http\Controllers; use Illuminate\Http\JsonResponse; +use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Cache; class NotificationController extends Controller { - public function visualizeAllNotifications(): JsonResponse + public function visualizeAllNotifications(Request $request): JsonResponse { - $user = auth()->user(); + $user = $request->user(); $user->unreadNotifications->markAsRead(); @@ -19,9 +20,9 @@ public function visualizeAllNotifications(): JsonResponse return $this->respondWithCustomData(['message' => 'OK'], Response::HTTP_OK); } - public function visualizeNotification(string $id): JsonResponse + public function visualizeNotification(Request $request, string $id): JsonResponse { - $user = auth()->user(); + $user = $request->user(); $user->unreadNotifications()->findOrFail($id)->update(['read_at' => now()]); diff --git a/default-structure/app/Http/Requests/UserUpdateRequest.php b/default-structure/app/Http/Requests/UserUpdateRequest.php index 5e1d09c..1ecacf7 100644 --- a/default-structure/app/Http/Requests/UserUpdateRequest.php +++ b/default-structure/app/Http/Requests/UserUpdateRequest.php @@ -11,9 +11,9 @@ class UserUpdateRequest extends FormRequest */ public function authorize(): bool { - $id = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); + $id = $this->segment(2) === 'me' ? $this->user()->id : $this->segment(3); - return $this->user()->can('update users') || $id === auth()->id(); + return $this->user()->can('update users') || $id === $this->user()->id; } /** @@ -23,7 +23,7 @@ public function authorize(): bool */ public function rules(): array { - $ignoreId = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); + $ignoreId = $this->segment(2) === 'me' ? $this->user()->id : $this->segment(3); return [ 'email' => [ diff --git a/default-structure/app/Providers/RepositoryServiceProvider.php b/default-structure/app/Providers/RepositoryServiceProvider.php index 9185966..d4e40c4 100644 --- a/default-structure/app/Providers/RepositoryServiceProvider.php +++ b/default-structure/app/Providers/RepositoryServiceProvider.php @@ -38,8 +38,6 @@ public function register() $this->app->singleton(UserRepository::class, function () { return new EloquentUserRepository(new User()); }); - - //:end-bindings: } /** diff --git a/modular-structure/.env.example b/modular-structure/.env.example index bf03b6d..676500d 100644 --- a/modular-structure/.env.example +++ b/modular-structure/.env.example @@ -3,6 +3,7 @@ APP_ENV=local APP_KEY=base64:g1480dNK9TleD6NNmP0l29nPS0y8aYy/r9kBtlzmMmg= APP_DEBUG=true APP_URL=http://localhost +SPA_URL=http://localhost:3000 LOG_CHANNEL=stack diff --git a/modular-structure/.env.testing b/modular-structure/.env.testing index 775f21e..78251f6 100644 --- a/modular-structure/.env.testing +++ b/modular-structure/.env.testing @@ -3,6 +3,7 @@ APP_ENV=testing APP_KEY=base64:g1480dNK9TleD6NNmP0l29nPS0y8aYy/r9kBtlzmMmg= APP_DEBUG=true APP_URL=http://localhost +SPA_URL=http://localhost:3000 LOG_CHANNEL=stack diff --git a/modular-structure/app/Application/Http/Middlewares/SetLocale.php b/modular-structure/app/Application/Http/Middlewares/SetLocale.php index 2466996..33a616a 100644 --- a/modular-structure/app/Application/Http/Middlewares/SetLocale.php +++ b/modular-structure/app/Application/Http/Middlewares/SetLocale.php @@ -16,7 +16,7 @@ class SetLocale public function handle($request, Closure $next) { if (auth()->check()) { - app()->setLocale(auth()->user()->locale); + app()->setLocale($request->user()->locale); } return $next($request); diff --git a/modular-structure/app/Domain/Audits/Policies/AuditPolicy.php b/modular-structure/app/Domain/Audits/Policies/AuditPolicy.php index 4f521f3..70b34b2 100644 --- a/modular-structure/app/Domain/Audits/Policies/AuditPolicy.php +++ b/modular-structure/app/Domain/Audits/Policies/AuditPolicy.php @@ -2,20 +2,21 @@ namespace App\Domain\Audits\Policies; +use App\Domain\Users\Entities\User; use Illuminate\Auth\Access\HandlesAuthorization; class AuditPolicy { use HandlesAuthorization; - public function viewAny(): bool + public function viewAny(User $user): bool { - return auth()->user()->hasPermissionTo('audits_list'); + return $user->hasPermissionTo('audits_list'); } - public function view(): bool + public function view(User $user): bool { - return auth()->user()->hasPermissionTo('audits_view'); + return $user->hasPermissionTo('audits_view'); } public function create(): bool diff --git a/modular-structure/app/Domain/Audits/Providers/DomainServiceProvider.php b/modular-structure/app/Domain/Audits/Providers/DomainServiceProvider.php index 635b54c..9466b6e 100644 --- a/modular-structure/app/Domain/Audits/Providers/DomainServiceProvider.php +++ b/modular-structure/app/Domain/Audits/Providers/DomainServiceProvider.php @@ -8,17 +8,17 @@ class DomainServiceProvider extends ServiceProvider { - protected $alias = 'audits'; + protected string $alias = 'audits'; - protected $hasMigrations = true; + protected bool $hasMigrations = true; - protected $hasPolicies = true; + protected bool $hasPolicies = true; - protected $policies = [ + protected array $policies = [ Audit::class => AuditPolicy::class, ]; - protected $providers = [ + protected array $providers = [ EventServiceProvider::class, ]; } diff --git a/modular-structure/app/Domain/Notifications/Policies/NotificationPolicy.php b/modular-structure/app/Domain/Notifications/Policies/NotificationPolicy.php index 4ab300e..15076d6 100644 --- a/modular-structure/app/Domain/Notifications/Policies/NotificationPolicy.php +++ b/modular-structure/app/Domain/Notifications/Policies/NotificationPolicy.php @@ -2,20 +2,21 @@ namespace App\Domain\Notifications\Policies; +use App\Domain\Users\Entities\User; use Illuminate\Auth\Access\HandlesAuthorization; class NotificationPolicy { use HandlesAuthorization; - public function viewAny(): bool + public function viewAny(User $user): bool { - return auth()->user()->hasPermissionTo('notifications_list'); + return $user->can('notifications_list'); } - public function view(): bool + public function view(User $user): bool { - return auth()->user()->hasPermissionTo('notifications_view'); + return $user->can('notifications_view'); } public function create(): bool diff --git a/modular-structure/app/Domain/Notifications/Providers/DomainServiceProvider.php b/modular-structure/app/Domain/Notifications/Providers/DomainServiceProvider.php index ae4c6ff..3b3e0a5 100644 --- a/modular-structure/app/Domain/Notifications/Providers/DomainServiceProvider.php +++ b/modular-structure/app/Domain/Notifications/Providers/DomainServiceProvider.php @@ -8,13 +8,13 @@ class DomainServiceProvider extends ServiceProvider { - protected $alias = 'notifications'; + protected string $alias = 'notifications'; - protected $hasMigrations = true; + protected bool $hasMigrations = true; - protected $hasPolicies = true; + protected bool $hasPolicies = true; - protected $policies = [ + protected array $policies = [ DatabaseNotification::class => NotificationPolicy::class, ]; } diff --git a/modular-structure/app/Domain/Users/Contracts/AuthorizedDeviceRepository.php b/modular-structure/app/Domain/Users/Contracts/AuthorizedDeviceRepository.php index 93eb75b..eba753f 100644 --- a/modular-structure/app/Domain/Users/Contracts/AuthorizedDeviceRepository.php +++ b/modular-structure/app/Domain/Users/Contracts/AuthorizedDeviceRepository.php @@ -3,10 +3,12 @@ namespace App\Domain\Users\Contracts; use App\Infrastructure\Contracts\BaseRepository; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; interface AuthorizedDeviceRepository extends BaseRepository { public function doesNotHaveAuthorizedAnyDeviceYet(string $userId): bool; - public function findDeviceByCriteria(array $data); + public function findDeviceByCriteria(array $data): Model|Builder|null; } diff --git a/modular-structure/app/Domain/Users/Http/Controllers/AuthorizeDeviceController.php b/modular-structure/app/Domain/Users/Http/Controllers/AuthorizeDeviceController.php index 0488472..59db502 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/AuthorizeDeviceController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/AuthorizeDeviceController.php @@ -5,11 +5,12 @@ use App\Domain\Users\Entities\AuthorizedDevice; use App\Interfaces\Http\Controllers\Controller; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class AuthorizeDeviceController extends Controller { - public function authorizeDevice(string $token) + public function authorizeDevice(string $token): JsonResponse { $authorizedDevice = AuthorizedDevice::query() ->withoutGlobalScopes() @@ -31,7 +32,7 @@ public function authorizeDevice(string $token) return $this->respondWithCustomData(['message' => $message], Response::HTTP_BAD_REQUEST); } - public function destroy(string $id) + public function destroy(string $id): JsonResponse { $model = AuthorizedDevice::findOrFail($id); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/DisableAccountController.php b/modular-structure/app/Domain/Users/Http/Controllers/DisableAccountController.php index 1be2cf0..cfbd4bc 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/DisableAccountController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/DisableAccountController.php @@ -4,6 +4,7 @@ use App\Domain\Users\Services\DisableAccountService; use App\Interfaces\Http\Controllers\Controller; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class DisableAccountController extends Controller @@ -15,7 +16,7 @@ public function __construct(DisableAccountService $disableAccountService) $this->disableAccountService = $disableAccountService; } - public function disable($token) + public function disable($token): JsonResponse { $response = $this->disableAccountService->handle($token); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/EmailVerificationController.php b/modular-structure/app/Domain/Users/Http/Controllers/EmailVerificationController.php index 6f34994..881fd44 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/EmailVerificationController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/EmailVerificationController.php @@ -6,11 +6,12 @@ use App\Domain\Users\Events\EmailWasVerifiedEvent; use App\Interfaces\Http\Controllers\Controller; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class EmailVerificationController extends Controller { - public function verify($token) + public function verify($token): JsonResponse { try { $user = app(UserRepository::class)->findOneBy(['email_token_confirmation' => $token]); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php b/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php index f32de73..1f59366 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/LoginController.php @@ -55,7 +55,7 @@ protected function attemptLogin(Request $request) */ protected function sendLoginResponse(Request $request) { - $user = auth()->user(); + $user = $request->user(); try { $this->checkUserIfIsActive($user, $request); @@ -114,7 +114,7 @@ public function logout(Request $request) Cache::forget($id); Cache::tags('users:' . $id)->flush(); - $this->guard()->logout(true); + $this->guard()->logout(); } private function checkIfUserHasVerifiedEmail(User $user, Request $request) diff --git a/modular-structure/app/Domain/Users/Http/Controllers/NotificationController.php b/modular-structure/app/Domain/Users/Http/Controllers/NotificationController.php index 576de33..e90fd40 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/NotificationController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/NotificationController.php @@ -3,14 +3,16 @@ namespace App\Domain\Users\Http\Controllers; use App\Interfaces\Http\Controllers\Controller; +use Illuminate\Http\JsonResponse; +use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Cache; class NotificationController extends Controller { - public function visualizeAllNotifications() + public function visualizeAllNotifications(Request $request): JsonResponse { - $user = auth()->user(); + $user = $request->user(); $user->unreadNotifications->markAsRead(); @@ -19,9 +21,9 @@ public function visualizeAllNotifications() return $this->respondWithCustomData(['message' => 'OK'], Response::HTTP_OK); } - public function visualizeNotification(string $id) + public function visualizeNotification(Request $request, string $id): JsonResponse { - $user = auth()->user(); + $user = $request->user(); $user->unreadNotifications()->findOrFail($id)->update(['read_at' => now()]); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/RegisterController.php b/modular-structure/app/Domain/Users/Http/Controllers/RegisterController.php index e5f9b04..b1bb991 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/RegisterController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/RegisterController.php @@ -6,6 +6,7 @@ use App\Domain\Users\Entities\User; use App\Domain\Users\Rules\WeakPasswordRule; use App\Interfaces\Http\Controllers\Controller; +use Illuminate\Database\Eloquent\Model; use Illuminate\Foundation\Auth\RegistersUsers; use Illuminate\Http\Request; use Illuminate\Http\Response; @@ -32,7 +33,7 @@ class RegisterController extends Controller * * @return void */ - public function __construct() + public function __construct(private UserRepository $userRepository) { $this->middleware('guest'); } @@ -94,16 +95,10 @@ protected function validator(array $data) /** * Create a new user instance after a valid registration. - * - * @param array $data - * @return User - * @throws \Exception */ - protected function create(array $data) + protected function create(array $data): Model { - $userRepository = app(UserRepository::class); - - return $userRepository->store([ + return $this->userRepository->store([ 'email' => $data['email'], 'name' => $data['name'], 'email_token_confirmation' => Uuid::uuid4()->toString(), diff --git a/modular-structure/app/Domain/Users/Http/Controllers/TwoFactorAuthenticationController.php b/modular-structure/app/Domain/Users/Http/Controllers/TwoFactorAuthenticationController.php index e29f5f2..bd8d606 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/TwoFactorAuthenticationController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/TwoFactorAuthenticationController.php @@ -9,6 +9,7 @@ use App\Infrastructure\Support\TwoFactorAuthenticator; use App\Interfaces\Http\Controllers\Controller; use Exception; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\Cache; @@ -20,15 +21,13 @@ class TwoFactorAuthenticationController extends Controller /** * Generate a new 2fa entry for current logged user. * - * @param Request $request - * @return \Illuminate\Http\JsonResponse * @throws \Exception */ - public function generate2faSecret(Request $request) + public function generate2faSecret(Request $request): JsonResponse { $twoFactorAuthentication = new TwoFactorAuthenticator($request); - $user = auth()->user(); + $user = $request->user(); $user->google2fa_enable = false; $user->google2fa_secret = $twoFactorAuthentication->generateSecretKey(32); @@ -49,16 +48,13 @@ public function generate2faSecret(Request $request) /** * Enable the previously generated 2fa. - * - * @param EnableTwoFactorAuthenticationRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function enable2fa(EnableTwoFactorAuthenticationRequest $request) + public function enable2fa(EnableTwoFactorAuthenticationRequest $request): JsonResponse { $twoFactorAuthentication = new TwoFactorAuthenticator($request); $secret = $request->input('one_time_password'); - $user = auth()->user(); + $user = $request->user(); try { $valid = $twoFactorAuthentication->verifyKey($user->google2fa_secret, $secret); @@ -87,13 +83,10 @@ public function enable2fa(EnableTwoFactorAuthenticationRequest $request) /** * Disable the 2fa of current logged user. - * - * @param DisableTwoFactorAuthenticationRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function disable2fa(DisableTwoFactorAuthenticationRequest $request) + public function disable2fa(DisableTwoFactorAuthenticationRequest $request): JsonResponse { - $user = auth()->user(); + $user = $request->user(); if (!Hash::check($request->get('password'), $user->password)) { return $this->respondWithCustomData( @@ -117,11 +110,8 @@ public function disable2fa(DisableTwoFactorAuthenticationRequest $request) /** * If request pass of middleware, the OTP was successfully verified. - * - * @param Request $request - * @return \Illuminate\Http\JsonResponse */ - public function verify2fa(Request $request) + public function verify2fa(Request $request): JsonResponse { Cache::tags('users:' . auth()->id())->flush(); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/UserController.php b/modular-structure/app/Domain/Users/Http/Controllers/UserController.php index 969069b..741126f 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/UserController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/UserController.php @@ -14,11 +14,8 @@ class UserController extends Controller { - private UserRepository $userRepository; - - public function __construct(UserRepository $userRepository) + public function __construct(private UserRepository $userRepository) { - $this->userRepository = $userRepository; $this->resourceItem = UserResource::class; $this->resourceCollection = UserCollection::class; $this->authorizeResource(User::class); @@ -26,10 +23,8 @@ public function __construct(UserRepository $userRepository) /** * List all users. - * - * @return \Illuminate\Http\JsonResponse */ - public function index() + public function index(): UserCollection { $cacheTag = 'users'; $cacheKey = 'users:' . auth()->id() . json_encode(request()->all()); @@ -43,24 +38,17 @@ public function index() /** * Show a current logged user. - * - * @param Request $request - * @return \Illuminate\Http\JsonResponse */ - public function profile(Request $request) + public function profile(Request $request): UserResource { - $user = auth()->user(); + $user = $request->user(); return $this->show($request, $user); } /** * Show an user. - * - * @param Request $request - * @param User $user - * @return \Illuminate\Http\JsonResponse */ - public function show(Request $request, User $user) + public function show(Request $request, User $user): UserResource { $allowedIncludes = [ 'loginhistories', @@ -85,24 +73,17 @@ public function show(Request $request, User $user) /** * Update the current logged user. - * - * @param UserUpdateRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function updateMe(UserUpdateRequest $request) + public function updateMe(UserUpdateRequest $request): UserResource { - $user = auth()->user(); + $user = $request->user(); return $this->update($request, $user); } /** * Update an user. - * - * @param UserUpdateRequest $request - * @param User $user - * @return \Illuminate\Http\JsonResponse */ - public function update(UserUpdateRequest $request, User $user) + public function update(UserUpdateRequest $request, User $user): UserResource { $data = $request->validated(); $response = $this->userRepository->update($user, $data); @@ -112,13 +93,10 @@ public function update(UserUpdateRequest $request, User $user) /** * Update password of logged user. - * - * @param PasswordUpdateRequest $request - * @return \Illuminate\Http\JsonResponse */ - public function updatePassword(PasswordUpdateRequest $request) + public function updatePassword(PasswordUpdateRequest $request): UserResource { - $user = auth()->user(); + $user = $request->user(); $data = $request->only(['password']); $response = $this->userRepository->update($user, $data); diff --git a/modular-structure/app/Domain/Users/Http/Controllers/UtilController.php b/modular-structure/app/Domain/Users/Http/Controllers/UtilController.php index fcd224e..81a287f 100644 --- a/modular-structure/app/Domain/Users/Http/Controllers/UtilController.php +++ b/modular-structure/app/Domain/Users/Http/Controllers/UtilController.php @@ -3,11 +3,12 @@ namespace App\Domain\Users\Http\Controllers; use App\Interfaces\Http\Controllers\Controller; +use Illuminate\Http\JsonResponse; use Illuminate\Http\Response; class UtilController extends Controller { - public function serverTime() + public function serverTime(): JsonResponse { $now = now(); $milliseconds = substr((string)$now->micro, 0, 3); diff --git a/modular-structure/app/Domain/Users/Http/Requests/DisableTwoFactorAuthenticationRequest.php b/modular-structure/app/Domain/Users/Http/Requests/DisableTwoFactorAuthenticationRequest.php index 63fe6a2..abb5bad 100644 --- a/modular-structure/app/Domain/Users/Http/Requests/DisableTwoFactorAuthenticationRequest.php +++ b/modular-structure/app/Domain/Users/Http/Requests/DisableTwoFactorAuthenticationRequest.php @@ -8,20 +8,16 @@ class DisableTwoFactorAuthenticationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ - public function authorize() + public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. - * - * @return array */ - public function rules() + public function rules(): array { return [ 'password' => [ diff --git a/modular-structure/app/Domain/Users/Http/Requests/EnableTwoFactorAuthenticationRequest.php b/modular-structure/app/Domain/Users/Http/Requests/EnableTwoFactorAuthenticationRequest.php index 9b20343..a6502aa 100644 --- a/modular-structure/app/Domain/Users/Http/Requests/EnableTwoFactorAuthenticationRequest.php +++ b/modular-structure/app/Domain/Users/Http/Requests/EnableTwoFactorAuthenticationRequest.php @@ -8,20 +8,16 @@ class EnableTwoFactorAuthenticationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ - public function authorize() + public function authorize(): bool { return true; } /** * Get the validation rules that apply to the request. - * - * @return array */ - public function rules() + public function rules(): array { return [ 'one_time_password' => [ diff --git a/modular-structure/app/Domain/Users/Http/Requests/PasswordUpdateRequest.php b/modular-structure/app/Domain/Users/Http/Requests/PasswordUpdateRequest.php index da80a87..0f5b96f 100644 --- a/modular-structure/app/Domain/Users/Http/Requests/PasswordUpdateRequest.php +++ b/modular-structure/app/Domain/Users/Http/Requests/PasswordUpdateRequest.php @@ -20,10 +20,8 @@ public function authorize() /** * Get the validation rules that apply to the request. - * - * @return array */ - public function rules() + public function rules(): array { return [ 'current_password' => [ diff --git a/modular-structure/app/Domain/Users/Http/Requests/UserUpdateRequest.php b/modular-structure/app/Domain/Users/Http/Requests/UserUpdateRequest.php index 1fce155..a385903 100644 --- a/modular-structure/app/Domain/Users/Http/Requests/UserUpdateRequest.php +++ b/modular-structure/app/Domain/Users/Http/Requests/UserUpdateRequest.php @@ -8,24 +8,20 @@ class UserUpdateRequest extends FormRequest { /** * Determine if the user is authorized to make this request. - * - * @return bool */ - public function authorize() + public function authorize(): bool { - $id = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); + $id = $this->segment(2) === 'me' ? $this->user()->id : $this->segment(3); - return auth()->user()->can('update users') || $id === auth()->id(); + return $this->user()->can('update users') || $id === $this->user()->id; } /** * Get the validation rules that apply to the request. - * - * @return array */ - public function rules() + public function rules(): array { - $ignoreId = $this->segment(2) === 'me' ? auth()->id() : $this->segment(3); + $ignoreId = $this->segment(2) === 'me' ? $this->user()->id : $this->segment(3); return [ 'email' => [ diff --git a/modular-structure/app/Domain/Users/Notifications/AccountDisabledNotification.php b/modular-structure/app/Domain/Users/Notifications/AccountDisabledNotification.php index f712746..a789aac 100644 --- a/modular-structure/app/Domain/Users/Notifications/AccountDisabledNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/AccountDisabledNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $supportLink = config('app.support_url'); diff --git a/modular-structure/app/Domain/Users/Notifications/AuthorizeDeviceNotification.php b/modular-structure/app/Domain/Users/Notifications/AuthorizeDeviceNotification.php index 7d3c240..8a28be9 100644 --- a/modular-structure/app/Domain/Users/Notifications/AuthorizeDeviceNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/AuthorizeDeviceNotification.php @@ -11,20 +11,17 @@ class AuthorizeDeviceNotification extends Notification implements ShouldQueue { use Queueable; - private array $data; - - public function __construct(array $data) + public function __construct(private array $data) { - $this->data = $data; $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/modular-structure/app/Domain/Users/Notifications/PasswordChangedNotification.php b/modular-structure/app/Domain/Users/Notifications/PasswordChangedNotification.php index daa4ecc..04e1f8e 100644 --- a/modular-structure/app/Domain/Users/Notifications/PasswordChangedNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/PasswordChangedNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/modular-structure/app/Domain/Users/Notifications/SuccessfulLoginFromIpNotification.php b/modular-structure/app/Domain/Users/Notifications/SuccessfulLoginFromIpNotification.php index 80d4ad8..ed93ce9 100644 --- a/modular-structure/app/Domain/Users/Notifications/SuccessfulLoginFromIpNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/SuccessfulLoginFromIpNotification.php @@ -11,15 +11,12 @@ class SuccessfulLoginFromIpNotification extends Notification implements ShouldQu { use Queueable; - private array $data; - - public function __construct(array $data) + public function __construct(private array $data) { - $this->data = $data; $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } diff --git a/modular-structure/app/Domain/Users/Notifications/TwoFactorAuthenticationWasDisabledNotification.php b/modular-structure/app/Domain/Users/Notifications/TwoFactorAuthenticationWasDisabledNotification.php index 9410edc..027bd75 100644 --- a/modular-structure/app/Domain/Users/Notifications/TwoFactorAuthenticationWasDisabledNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/TwoFactorAuthenticationWasDisabledNotification.php @@ -16,12 +16,12 @@ public function __construct() $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { $antiPhishingCode = $notifiable->anti_phishing_code; $disableAccountToken = $notifiable->email_token_disable_account; diff --git a/modular-structure/app/Domain/Users/Notifications/VerifyEmailNotification.php b/modular-structure/app/Domain/Users/Notifications/VerifyEmailNotification.php index 225fb88..52b0318 100644 --- a/modular-structure/app/Domain/Users/Notifications/VerifyEmailNotification.php +++ b/modular-structure/app/Domain/Users/Notifications/VerifyEmailNotification.php @@ -11,20 +11,17 @@ class VerifyEmailNotification extends Notification implements ShouldQueue { use Queueable; - private string $token; - - public function __construct(string $token) + public function __construct(private string $token) { - $this->token = $token; $this->onQueue('notifications'); } - public function via() + public function via(): array { return ['mail']; } - public function toMail($notifiable) + public function toMail($notifiable): MailMessage { return (new MailMessage()) ->markdown('emails.default') diff --git a/modular-structure/app/Domain/Users/Policies/AuthorizedDevicePolicy.php b/modular-structure/app/Domain/Users/Policies/AuthorizedDevicePolicy.php index 308a603..19410c5 100644 --- a/modular-structure/app/Domain/Users/Policies/AuthorizedDevicePolicy.php +++ b/modular-structure/app/Domain/Users/Policies/AuthorizedDevicePolicy.php @@ -12,78 +12,56 @@ class AuthorizedDevicePolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any authorized devices'); } /** * Determine whether the user can view the model. - * - * @param \App\Domain\Users\Entities\User $user - * @param \App\Domain\Users\Entities\AuthorizedDevice $model - * @return mixed */ - public function view(User $user, AuthorizedDevice $model) + public function view(User $user, AuthorizedDevice $model): bool { return $user->can('view authorized devices') || $user->id === $model->user_id; } /** * Determine whether the user can create models. - * - * @return mixed */ - public function create() + public function create(): bool { return false; } /** * Determine whether the user can update the model. - * - * @param \App\Domain\Users\Entities\User $user - * @param \App\Domain\Users\Entities\AuthorizedDevice $model - * @return mixed */ - public function update(User $user, AuthorizedDevice $model) + public function update(User $user, AuthorizedDevice $model): bool { return $user->can('update authorized devices') || $user->id === $model->user_id; } /** * Determine whether the user can delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete authorized devices'); } /** * Determine whether the user can restore the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore authorized devices'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete authorized devices'); } diff --git a/modular-structure/app/Domain/Users/Policies/LoginHistoryPolicy.php b/modular-structure/app/Domain/Users/Policies/LoginHistoryPolicy.php index 30ef8c3..bb8eb43 100644 --- a/modular-structure/app/Domain/Users/Policies/LoginHistoryPolicy.php +++ b/modular-structure/app/Domain/Users/Policies/LoginHistoryPolicy.php @@ -12,73 +12,56 @@ class LoginHistoryPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any login histories'); } /** * Determine whether the user can view the model. - * - * @param \App\Domain\Users\Entities\User $user - * @param \App\Domain\Users\Entities\LoginHistory $model - * @return mixed */ - public function view(User $user, LoginHistory $model) + public function view(User $user, LoginHistory $model): bool { return $user->can('view login histories') || $user->id === $model->user_id; } /** * Determine whether the user can create models. - * - * @return mixed */ - public function create() + public function create(): bool { return false; } /** * Determine whether the user can update the model. - * - * @return mixed */ - public function update() + public function update(): bool { return false; } /** * Determine whether the user can delete the model. - * - * @return mixed */ - public function delete() + public function delete(): bool { return false; } /** * Determine whether the user can restore the model. - * - * @return mixed */ - public function restore() + public function restore(): bool { return false; } /** * Determine whether the user can permanently delete the model. - * - * @return mixed */ - public function forceDelete() + public function forceDelete(): bool { return false; } diff --git a/modular-structure/app/Domain/Users/Policies/PermissionPolicy.php b/modular-structure/app/Domain/Users/Policies/PermissionPolicy.php index 5499403..a81f2a4 100644 --- a/modular-structure/app/Domain/Users/Policies/PermissionPolicy.php +++ b/modular-structure/app/Domain/Users/Policies/PermissionPolicy.php @@ -11,77 +11,56 @@ class PermissionPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any permissions'); } /** * Determine whether the user can view the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function view(User $user) + public function view(User $user): bool { return $user->can('view permissions'); } /** * Determine whether the user can create models. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create permissions'); } /** * Determine whether the user can update the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function update(User $user) + public function update(User $user): bool { return $user->can('update permissions'); } /** * Determine whether the user can delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete permissions'); } /** * Determine whether the user can restore the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore permissions'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete permissions'); } diff --git a/modular-structure/app/Domain/Users/Policies/RolePolicy.php b/modular-structure/app/Domain/Users/Policies/RolePolicy.php index 14f7623..2e7b95b 100644 --- a/modular-structure/app/Domain/Users/Policies/RolePolicy.php +++ b/modular-structure/app/Domain/Users/Policies/RolePolicy.php @@ -11,77 +11,56 @@ class RolePolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { - return $user->can('view any roles'); + return $user->can('view any permissions'); } /** * Determine whether the user can view the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function view(User $user) + public function view(User $user): bool { return $user->can('view roles'); } /** * Determine whether the user can create models. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create roles'); } /** * Determine whether the user can update the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function update(User $user) + public function update(User $user): bool { return $user->can('update roles'); } /** * Determine whether the user can delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete roles'); } /** * Determine whether the user can restore the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore roles'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete roles'); } diff --git a/modular-structure/app/Domain/Users/Policies/UserPolicy.php b/modular-structure/app/Domain/Users/Policies/UserPolicy.php index bcc64b3..a67994f 100644 --- a/modular-structure/app/Domain/Users/Policies/UserPolicy.php +++ b/modular-structure/app/Domain/Users/Policies/UserPolicy.php @@ -11,79 +11,56 @@ class UserPolicy /** * Determine whether the user can view a list of model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function viewAny(User $user) + public function viewAny(User $user): bool { return $user->can('view any users'); } /** * Determine whether the user can view the model. - * - * @param \App\Domain\Users\Entities\User $user - * @param \App\Domain\Users\Entities\User $model - * @return mixed */ - public function view(User $user, User $model) + public function view(User $user, User $model): bool { return $user->can('view users') || $user->id === $model->id; } /** * Determine whether the user can create models. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function create(User $user) + public function create(User $user): bool { return $user->can('create users'); } /** * Determine whether the user can update the model. - * - * @param \App\Domain\Users\Entities\User $user - * @param \App\Domain\Users\Entities\User $model - * @return mixed */ - public function update(User $user, User $model) + public function update(User $user, User $model): bool { return $user->can('update users') || $user->id === $model->id; } /** * Determine whether the user can delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function delete(User $user) + public function delete(User $user): bool { return $user->can('delete users'); } /** * Determine whether the user can restore the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function restore(User $user) + public function restore(User $user): bool { return $user->can('restore users'); } /** * Determine whether the user can permanently delete the model. - * - * @param \App\Domain\Users\Entities\User $user - * @return mixed */ - public function forceDelete(User $user) + public function forceDelete(User $user): bool { return $user->can('force delete users'); } diff --git a/modular-structure/app/Domain/Users/Providers/DomainServiceProvider.php b/modular-structure/app/Domain/Users/Providers/DomainServiceProvider.php index ffe594e..9ed6696 100644 --- a/modular-structure/app/Domain/Users/Providers/DomainServiceProvider.php +++ b/modular-structure/app/Domain/Users/Providers/DomainServiceProvider.php @@ -2,9 +2,6 @@ namespace App\Domain\Users\Providers; -use App\Domain\Users\Database\Factories\AuthorizedDeviceFactory; -use App\Domain\Users\Database\Factories\LoginHistoryFactory; -use App\Domain\Users\Database\Factories\UserFactory; use App\Domain\Users\Entities\AuthorizedDevice; use App\Domain\Users\Entities\LoginHistory; use App\Domain\Users\Entities\Permission; @@ -19,34 +16,26 @@ class DomainServiceProvider extends ServiceProvider { - protected $alias = 'users'; + protected string $alias = 'users'; - protected $hasMigrations = true; + protected bool $hasMigrations = true; - protected $hasTranslations = true; + protected bool $hasTranslations = true; - protected $hasFactories = true; + protected bool $hasPolicies = true; - protected $hasPolicies = true; - - protected $providers = [ + protected array $providers = [ RouteServiceProvider::class, RepositoryServiceProvider::class, EventServiceProvider::class, // BroadcastServiceProvider::class, ]; - protected $policies = [ + protected array $policies = [ AuthorizedDevice::class => AuthorizedDevicePolicy::class, LoginHistory::class => LoginHistoryPolicy::class, Permission::class => PermissionPolicy::class, Role::class => RolePolicy::class, User::class => UserPolicy::class, ]; - - protected $factories = [ - AuthorizedDeviceFactory::class, - LoginHistoryFactory::class, - UserFactory::class, - ]; } diff --git a/modular-structure/app/Domain/Users/Providers/RepositoryServiceProvider.php b/modular-structure/app/Domain/Users/Providers/RepositoryServiceProvider.php index 7c07af2..d818c8d 100644 --- a/modular-structure/app/Domain/Users/Providers/RepositoryServiceProvider.php +++ b/modular-structure/app/Domain/Users/Providers/RepositoryServiceProvider.php @@ -17,10 +17,8 @@ class RepositoryServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. - * - * @var bool */ - protected $defer = true; + protected bool $defer = true; /** * Register the application services. diff --git a/modular-structure/app/Domain/Users/Repositories/EloquentAuthorizedDevicesRepository.php b/modular-structure/app/Domain/Users/Repositories/EloquentAuthorizedDevicesRepository.php index a195e46..d056ead 100644 --- a/modular-structure/app/Domain/Users/Repositories/EloquentAuthorizedDevicesRepository.php +++ b/modular-structure/app/Domain/Users/Repositories/EloquentAuthorizedDevicesRepository.php @@ -4,6 +4,8 @@ use App\Domain\Users\Contracts\AuthorizedDeviceRepository; use App\Infrastructure\Abstracts\EloquentRepository; +use Illuminate\Database\Eloquent\Builder; +use Illuminate\Database\Eloquent\Model; class EloquentAuthorizedDevicesRepository extends EloquentRepository implements AuthorizedDeviceRepository { @@ -12,7 +14,7 @@ public function doesNotHaveAuthorizedAnyDeviceYet(string $userId): bool return $this->model::query()->where('user_id', '=', $userId)->count('id') === 0; } - public function findDeviceByCriteria(array $data) + public function findDeviceByCriteria(array $data): Model|Builder|null { return $this->model::query() ->where('user_id', '=', $data['user_id']) diff --git a/modular-structure/app/Domain/Users/Repositories/EloquentLoginHistoryRepository.php b/modular-structure/app/Domain/Users/Repositories/EloquentLoginHistoryRepository.php index 1c7c0e5..78bacd7 100644 --- a/modular-structure/app/Domain/Users/Repositories/EloquentLoginHistoryRepository.php +++ b/modular-structure/app/Domain/Users/Repositories/EloquentLoginHistoryRepository.php @@ -9,7 +9,7 @@ class EloquentLoginHistoryRepository extends EloquentRepository implements Login { public function loginsWithThisIpExists(array $data): bool { - return $this->model->with([]) + return $this->model->query() ->where('user_id', '=', $data['user_id']) ->where('ip', '=', $data['ip']) ->exists(); diff --git a/modular-structure/app/Domain/Users/Services/DisableAccountService.php b/modular-structure/app/Domain/Users/Services/DisableAccountService.php index 54a04da..e79a2a3 100644 --- a/modular-structure/app/Domain/Users/Services/DisableAccountService.php +++ b/modular-structure/app/Domain/Users/Services/DisableAccountService.php @@ -47,7 +47,7 @@ private function loggoutUserIfNecessary() if (auth()->check()) { (new TwoFactorAuthenticator(request()))->logout(); Cache::forget(auth()->id()); - Cache::tags('users:' . auth()->id()); + Cache::tags('users:' . auth()->id())->flush(); auth()->logout(); } } diff --git a/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php b/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php index 18c2fd1..5c2ece8 100644 --- a/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php +++ b/modular-structure/app/Infrastructure/Abstracts/ServiceProvider.php @@ -11,52 +11,42 @@ abstract class ServiceProvider extends LaravelServiceProvider /** * @var string Alias for load tranlations and views */ - protected $alias; + protected string $alias; /** * @var bool Set if will load commands */ - protected $hasCommands = false; - - /** - * @var bool Set if will load factories - */ - protected $hasFactories = false; + protected bool $hasCommands = false; /** * @var bool Set if will load migrations */ - protected $hasMigrations = false; + protected bool $hasMigrations = false; /** * @var bool Set if will load translations */ - protected $hasTranslations = false; + protected bool $hasTranslations = false; /** * @var bool Set if will load policies */ - protected $hasPolicies = false; + protected bool $hasPolicies = false; /** * @var array List of custom Artisan commands */ - protected $commands = []; - - /** - * @var array List of model factories to load - */ - protected $factories = []; + protected array $commands = []; /** * @var array List of providers to load */ - protected $providers = []; + protected array $providers = []; /** * @var array List of policies to load */ - protected $policies = []; + protected array $policies = []; /** * Boot required registering of views and translations. @@ -114,7 +104,7 @@ protected function registerMigrations() * @return string * @throws \ReflectionException */ - protected function domainPath($append = null) + protected function domainPath($append = null): string { $reflection = new ReflectionClass($this); diff --git a/modular-structure/app/Interfaces/Http/Controllers/ResponseTrait.php b/modular-structure/app/Interfaces/Http/Controllers/ResponseTrait.php index 241314f..e6d6a68 100644 --- a/modular-structure/app/Interfaces/Http/Controllers/ResponseTrait.php +++ b/modular-structure/app/Interfaces/Http/Controllers/ResponseTrait.php @@ -38,8 +38,6 @@ protected function getTimestampInMilliseconds(): int /** * Return no content for delete requests - * - * @return JsonResponse */ protected function respondWithNoContent(): JsonResponse { @@ -51,9 +49,6 @@ protected function respondWithNoContent(): JsonResponse /** * Return collection response from the application - * - * @param LengthAwarePaginator $collection - * @return mixed */ protected function respondWithCollection(LengthAwarePaginator $collection) { @@ -64,9 +59,6 @@ protected function respondWithCollection(LengthAwarePaginator $collection) /** * Return single item response from the application - * - * @param Model $item - * @return mixed */ protected function respondWithItem(Model $item) { diff --git a/modular-structure/config/register.php b/modular-structure/config/register.php index aea6509..7c21d99 100644 --- a/modular-structure/config/register.php +++ b/modular-structure/config/register.php @@ -2,7 +2,6 @@ return [ 'commands' => env('REGISTER_COMMANDS', true), - 'factories' => env('REGISTER_FACTORIES', true), 'migrations' => env('REGISTER_MIGRATIONS', true), 'translations' => env('REGISTER_TRANSLATIONS', true), 'views' => env('REGISTER_VIEWS', true), From 81abf7d6423458854d8575c9c0a48d8a340c0cce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sun, 18 Apr 2021 09:38:21 -0300 Subject: [PATCH 6/8] chore: upgrade to Laravel 8.x Closes #25 --- .k8s/06-app-deployment.yaml | 14 +++++------ .k8s/09-queue-deployment.yaml | 23 ++++++++++++++----- .k8s/11-schedule-deployment.yaml | 6 ++--- .../000-default.conf | 0 .../06-app-deployment.yaml | 8 +++---- .../Dockerfile | 4 ++-- .../entrypoint.sh | 0 .../php.ini | 4 +--- .../Dockerfile | 2 +- .../php.ini | 4 +--- .../www.conf | 0 README.md | 4 ++-- default-structure/README.md | 2 +- 13 files changed, 39 insertions(+), 32 deletions(-) rename .k8s/{could-help-if-you-are-using-apache => can-help-if-you-are-using-apache}/000-default.conf (100%) rename .k8s/{could-help-if-you-are-using-apache => can-help-if-you-are-using-apache}/06-app-deployment.yaml (93%) rename .k8s/{could-help-if-you-are-using-apache => can-help-if-you-are-using-apache}/Dockerfile (91%) rename .k8s/{could-help-if-you-are-using-apache => can-help-if-you-are-using-apache}/entrypoint.sh (100%) rename .k8s/{could-help-if-you-are-using-apache => can-help-if-you-are-using-apache}/php.ini (99%) rename .k8s/{could-help-if-you-are-using-nginx => can-help-if-you-are-using-nginx}/Dockerfile (94%) rename .k8s/{could-help-if-you-are-using-nginx => can-help-if-you-are-using-nginx}/php.ini (99%) rename .k8s/{could-help-if-you-are-using-nginx => can-help-if-you-are-using-nginx}/www.conf (100%) diff --git a/.k8s/06-app-deployment.yaml b/.k8s/06-app-deployment.yaml index b0729a4..8423dd2 100755 --- a/.k8s/06-app-deployment.yaml +++ b/.k8s/06-app-deployment.yaml @@ -30,7 +30,7 @@ spec: args: - -c - | - sleep 12 + sleep 5 php artisan optimize php artisan view:cache ln -s public html @@ -42,8 +42,8 @@ spec: ports: - containerPort: 9000 readinessProbe: - initialDelaySeconds: 20 - periodSeconds: 10 + initialDelaySeconds: 5 + periodSeconds: 5 timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 @@ -51,8 +51,8 @@ spec: port: 9000 resources: requests: - cpu: 50m - memory: 320Mi + cpu: 100m + memory: 512Mi volumeMounts: - name: static mountPath: /static @@ -68,8 +68,8 @@ spec: "-credential_file=/secrets/cloudsql/cloudsqlproxy.json"] resources: requests: - cpu: 2m - memory: 8Mi + cpu: 10m + memory: 12Mi volumeMounts: - name: cloudsql-instance-credentials mountPath: /secrets/cloudsql diff --git a/.k8s/09-queue-deployment.yaml b/.k8s/09-queue-deployment.yaml index bef092f..d849a2e 100755 --- a/.k8s/09-queue-deployment.yaml +++ b/.k8s/09-queue-deployment.yaml @@ -30,17 +30,24 @@ spec: args: - -c - | - sleep 12 + sleep 5 php artisan migrate --force - php artisan config:cache + php artisan optimize + php artisan view:cache + ln -s public html + ln -s /var/www /usr/share/nginx + cp -r /var/www/public/. /static php artisan horizon --quiet envFrom: - secretRef: name: env resources: requests: - cpu: 50m - memory: 320Mi + cpu: 100m + memory: 512Mi + volumeMounts: + - name: static + mountPath: /static - name: cloudsql-proxy image: gcr.io/cloudsql-docker/gce-proxy:latest @@ -49,14 +56,18 @@ spec: "-credential_file=/secrets/cloudsql/cloudsqlproxy.json"] resources: requests: - cpu: 2m - memory: 8Mi + cpu: 10m + memory: 12Mi volumeMounts: - name: cloudsql-instance-credentials mountPath: /secrets/cloudsql readOnly: true volumes: + - name: static + nfs: + server: nfs-server.seguidores.svc.cluster.local + path: "/static" - name: cloudsql-instance-credentials secret: secretName: cloudsql-instance-credentials diff --git a/.k8s/11-schedule-deployment.yaml b/.k8s/11-schedule-deployment.yaml index 12035e1..2171c18 100755 --- a/.k8s/11-schedule-deployment.yaml +++ b/.k8s/11-schedule-deployment.yaml @@ -34,7 +34,7 @@ spec: resources: requests: cpu: 10m - memory: 32Mi + memory: 64Mi - name: cloudsql-proxy image: gcr.io/cloudsql-docker/gce-proxy:latest @@ -43,8 +43,8 @@ spec: "-credential_file=/secrets/cloudsql/cloudsqlproxy.json"] resources: requests: - cpu: 1m - memory: 8Mi + cpu: 10m + memory: 12Mi volumeMounts: - name: cloudsql-instance-credentials mountPath: /secrets/cloudsql diff --git a/.k8s/could-help-if-you-are-using-apache/000-default.conf b/.k8s/can-help-if-you-are-using-apache/000-default.conf similarity index 100% rename from .k8s/could-help-if-you-are-using-apache/000-default.conf rename to .k8s/can-help-if-you-are-using-apache/000-default.conf diff --git a/.k8s/could-help-if-you-are-using-apache/06-app-deployment.yaml b/.k8s/can-help-if-you-are-using-apache/06-app-deployment.yaml similarity index 93% rename from .k8s/could-help-if-you-are-using-apache/06-app-deployment.yaml rename to .k8s/can-help-if-you-are-using-apache/06-app-deployment.yaml index f94489e..dbefa60 100755 --- a/.k8s/could-help-if-you-are-using-apache/06-app-deployment.yaml +++ b/.k8s/can-help-if-you-are-using-apache/06-app-deployment.yaml @@ -40,8 +40,8 @@ spec: - containerPort: 8080 resources: requests: - cpu: 80m - memory: 320Mi + cpu: 100m + memory: 512Mi - name: cloudsql-proxy image: gcr.io/cloudsql-docker/gce-proxy:latest @@ -50,8 +50,8 @@ spec: "-credential_file=/secrets/cloudsql/cloudsqlproxy.json"] resources: requests: - cpu: 2m - memory: 8Mi + cpu: 10m + memory: 12Mi volumeMounts: - name: cloudsql-instance-credentials mountPath: /secrets/cloudsql diff --git a/.k8s/could-help-if-you-are-using-apache/Dockerfile b/.k8s/can-help-if-you-are-using-apache/Dockerfile similarity index 91% rename from .k8s/could-help-if-you-are-using-apache/Dockerfile rename to .k8s/can-help-if-you-are-using-apache/Dockerfile index b31ea98..0e1099a 100755 --- a/.k8s/could-help-if-you-are-using-apache/Dockerfile +++ b/.k8s/can-help-if-you-are-using-apache/Dockerfile @@ -1,9 +1,9 @@ -FROM composer:1.9.0 as build +FROM composer:2.0.12 as build WORKDIR /app COPY . /app RUN composer install --prefer-dist --classmap-authoritative --no-dev -FROM php:7.4.3-apache-buster +FROM php:8.0.3-apache-buster RUN docker-php-ext-install pdo pdo_pgsql pdo_mysql && pecl install redis COPY --from=build /app /var/www/ diff --git a/.k8s/could-help-if-you-are-using-apache/entrypoint.sh b/.k8s/can-help-if-you-are-using-apache/entrypoint.sh similarity index 100% rename from .k8s/could-help-if-you-are-using-apache/entrypoint.sh rename to .k8s/can-help-if-you-are-using-apache/entrypoint.sh diff --git a/.k8s/could-help-if-you-are-using-apache/php.ini b/.k8s/can-help-if-you-are-using-apache/php.ini similarity index 99% rename from .k8s/could-help-if-you-are-using-apache/php.ini rename to .k8s/can-help-if-you-are-using-apache/php.ini index 5b3f117..b389677 100755 --- a/.k8s/could-help-if-you-are-using-apache/php.ini +++ b/.k8s/can-help-if-you-are-using-apache/php.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,6 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so \ No newline at end of file diff --git a/.k8s/could-help-if-you-are-using-nginx/Dockerfile b/.k8s/can-help-if-you-are-using-nginx/Dockerfile similarity index 94% rename from .k8s/could-help-if-you-are-using-nginx/Dockerfile rename to .k8s/can-help-if-you-are-using-nginx/Dockerfile index 295f5fc..cf0b68e 100755 --- a/.k8s/could-help-if-you-are-using-nginx/Dockerfile +++ b/.k8s/can-help-if-you-are-using-nginx/Dockerfile @@ -1,4 +1,4 @@ -FROM ibrunotome/php:7.4-fpm +FROM ibrunotome/php:8.0-fpm ARG COMPOSER_FLAGS diff --git a/.k8s/could-help-if-you-are-using-nginx/php.ini b/.k8s/can-help-if-you-are-using-nginx/php.ini similarity index 99% rename from .k8s/could-help-if-you-are-using-nginx/php.ini rename to .k8s/can-help-if-you-are-using-nginx/php.ini index 5b3f117..b389677 100755 --- a/.k8s/could-help-if-you-are-using-nginx/php.ini +++ b/.k8s/can-help-if-you-are-using-nginx/php.ini @@ -1888,6 +1888,7 @@ opcache.enable = 1 ; Determines if Zend OPCache is enabled for the CLI version of PHP opcache.enable_cli = 1 +opcache.jit_buffer_size=100M ;opcache.preload=/var/www/storage/preload.php ;opcache.preload_user=www-data @@ -2016,6 +2017,3 @@ zend_optimizerplus.enable_file_override = 1 ; End: extension = redis.so -extension = decimal.so -extension = grpc.so -extension = protobuf.so \ No newline at end of file diff --git a/.k8s/could-help-if-you-are-using-nginx/www.conf b/.k8s/can-help-if-you-are-using-nginx/www.conf similarity index 100% rename from .k8s/could-help-if-you-are-using-nginx/www.conf rename to .k8s/can-help-if-you-are-using-nginx/www.conf diff --git a/README.md b/README.md index ef95fdb..f45b50c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- +
A Laravel API starter kit collection using different structures.

@@ -31,7 +31,7 @@ This is a starter kit for your next API using Laravel, implemented with more tha - Device authorization - Etag - Horizon -- Laravel [7.x](https://github.com/ibrunotome/laravel-api-templates/tree/v7.x), [6.x](https://github.com/ibrunotome/laravel-api-templates/tree/v6.x), [5.8](https://github.com/ibrunotome/laravel-api-templates/tree/v5.8) +- Laravel [8.x](https://github.com/ibrunotome/laravel-api-templates/tree/v8.x), [7.x](https://github.com/ibrunotome/laravel-api-templates/tree/v7.x), [6.x](https://github.com/ibrunotome/laravel-api-templates/tree/v6.x), [5.8](https://github.com/ibrunotome/laravel-api-templates/tree/v5.8) - Login - Login history - Multiple localizations, preconfigured with en_US and pt_BR diff --git a/default-structure/README.md b/default-structure/README.md index 966e961..a00581d 100644 --- a/default-structure/README.md +++ b/default-structure/README.md @@ -1,3 +1,3 @@ # Default Laravel structure -This API uses the default Laravel structure with all features explained [here](https://github.com/ibrunotome/laravel-api-templates#features). +This API uses the [default Laravel structure](https://laravel.com/docs/8.x/structure) with all features explained [here](https://github.com/ibrunotome/laravel-api-templates#features). From 4e94ba7ecdca7ea0cb59d51a0983d9b426269239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sun, 18 Apr 2021 09:40:46 -0300 Subject: [PATCH 7/8] refactor: typed properties in notifications --- .../app/Notifications/AuthorizeDeviceNotification.php | 4 +--- .../app/Notifications/SuccessfulLoginFromIpNotification.php | 5 +---- .../app/Notifications/VerifyEmailNotification.php | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/default-structure/app/Notifications/AuthorizeDeviceNotification.php b/default-structure/app/Notifications/AuthorizeDeviceNotification.php index acc5c59..5e93b79 100644 --- a/default-structure/app/Notifications/AuthorizeDeviceNotification.php +++ b/default-structure/app/Notifications/AuthorizeDeviceNotification.php @@ -11,11 +11,9 @@ class AuthorizeDeviceNotification extends Notification implements ShouldQueue { use Queueable; - private array $data; - public function __construct(array $data) + public function __construct(private array $data) { - $this->data = $data; $this->onQueue('notifications'); } diff --git a/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php b/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php index 7830343..9d3b76a 100644 --- a/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php +++ b/default-structure/app/Notifications/SuccessfulLoginFromIpNotification.php @@ -11,11 +11,8 @@ class SuccessfulLoginFromIpNotification extends Notification implements ShouldQu { use Queueable; - private array $data; - - public function __construct(array $data) + public function __construct(private array $data) { - $this->data = $data; $this->onQueue('notifications'); } diff --git a/default-structure/app/Notifications/VerifyEmailNotification.php b/default-structure/app/Notifications/VerifyEmailNotification.php index 22f0bfe..abbcfcb 100644 --- a/default-structure/app/Notifications/VerifyEmailNotification.php +++ b/default-structure/app/Notifications/VerifyEmailNotification.php @@ -11,11 +11,8 @@ class VerifyEmailNotification extends Notification implements ShouldQueue { use Queueable; - private string $token; - - public function __construct(string $token) + public function __construct(private string $token) { - $this->token = $token; $this->onQueue('notifications'); } From ad74285922a6a76514ce606911a76e7e1b93a24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Tom=C3=A9?= Date: Sun, 18 Apr 2021 09:50:59 -0300 Subject: [PATCH 8/8] ci: improve Architecture score --- modular-structure/composer.lock | 37 ++++++++++++++------------- modular-structure/config/insights.php | 1 + 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/modular-structure/composer.lock b/modular-structure/composer.lock index 1d5a19d..b73b159 100644 --- a/modular-structure/composer.lock +++ b/modular-structure/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "86624fe4dd9b7f24899fd723ec4d6374", + "content-hash": "4b8a8cf3f42e4874bff3b58a081bcb21", "packages": [ { "name": "aws/aws-sdk-php", @@ -9409,20 +9409,20 @@ }, { "name": "psr/cache", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/cache.git", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8" + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8", - "reference": "d11b50ad223250cf17b86e38383413f5a6764bf8", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { @@ -9442,7 +9442,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for caching libraries", @@ -9452,9 +9452,9 @@ "psr-6" ], "support": { - "source": "https://github.com/php-fig/cache/tree/master" + "source": "https://github.com/php-fig/cache/tree/2.0.0" }, - "time": "2016-08-06T20:24:11+00:00" + "time": "2021-02-03T23:23:37+00:00" }, { "name": "react/promise", @@ -10795,29 +10795,30 @@ }, { "name": "symfony/cache-contracts", - "version": "v2.2.0", + "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb" + "reference": "c0446463729b89dd4fa62e9aeecc80287323615d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/8034ca0b61d4dd967f3698aaa1da2507b631d0cb", - "reference": "8034ca0b61d4dd967f3698aaa1da2507b631d0cb", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/c0446463729b89dd4fa62e9aeecc80287323615d", + "reference": "c0446463729b89dd4fa62e9aeecc80287323615d", "shasum": "" }, "require": { "php": ">=7.2.5", - "psr/cache": "^1.0" + "psr/cache": "^1.0|^2.0|^3.0" }, "suggest": { "symfony/cache-implementation": "" }, + "default-branch": true, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-main": "2.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -10854,7 +10855,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.2.0" + "source": "https://github.com/symfony/cache-contracts/tree/main" }, "funding": [ { @@ -10870,7 +10871,7 @@ "type": "tidelift" } ], - "time": "2020-09-07T11:33:47+00:00" + "time": "2021-03-23T23:28:01+00:00" }, { "name": "symfony/filesystem", @@ -11344,7 +11345,7 @@ } ], "aliases": [], - "minimum-stability": "RC", + "minimum-stability": "dev", "stability-flags": { "tymon/jwt-auth": 20, "nunomaduro/phpinsights": 20 diff --git a/modular-structure/config/insights.php b/modular-structure/config/insights.php index e6b91ca..7bcb549 100644 --- a/modular-structure/config/insights.php +++ b/modular-structure/config/insights.php @@ -79,6 +79,7 @@ 'remove' => [ AlphabeticallySortedUsesSniff::class, ArrayIndentSniff::class, + ClassDeclaration::class, DeclareStrictTypesSniff::class, DisallowMixedTypeHintSniff::class, DisallowEmptySniff::class,