diff --git a/.editorconfig b/.editorconfig index 6f313c6a..af6cac5a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,8 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false -[*.yml] +[*.{yml,yaml}] indent_size = 2 + +[docker-compose.yml] +indent_size = 4 \ No newline at end of file diff --git a/.env.example b/.env.example index 7ce580a7..215f9816 100644 --- a/.env.example +++ b/.env.example @@ -72,6 +72,7 @@ DB_DATABASE="path/to/your/database.sqlite" # If you're looking for performance improvements, you could install memcached. CACHE_DRIVER=file SESSION_DRIVER=file +FILESYSTEM_DRIVER=local # Mail settings diff --git a/.gitignore b/.gitignore index 77d1f8ea..aa52c645 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ /node_modules +/public/hot /public/storage /storage/*.key /tests/Coverage diff --git a/.styleci.yml b/.styleci.yml index 1db61d96..877ea701 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -1,7 +1,8 @@ php: preset: laravel + version: 8 disabled: - - unused_use + - no_unused_imports finder: not-name: - index.php diff --git a/app/Api/v1/Controllers/Auth/RegisterController.php b/app/Api/v1/Controllers/Auth/RegisterController.php index 2552a876..e2ad2130 100644 --- a/app/Api/v1/Controllers/Auth/RegisterController.php +++ b/app/Api/v1/Controllers/Auth/RegisterController.php @@ -2,7 +2,7 @@ namespace App\Api\v1\Controllers\Auth; -use App\User; +use App\Models\User; use App\Api\v1\Requests\UserStoreRequest; use App\Http\Controllers\Controller; use Illuminate\Support\Facades\Hash; @@ -49,7 +49,7 @@ class RegisterController extends Controller * Create a new user instance after a valid registration. * * @param array $data - * @return \App\User + * @return \App\Models\User */ protected function create(array $data) { diff --git a/app/Api/v1/Controllers/Auth/UserController.php b/app/Api/v1/Controllers/Auth/UserController.php index 1549aa9c..efdf8bf8 100644 --- a/app/Api/v1/Controllers/Auth/UserController.php +++ b/app/Api/v1/Controllers/Auth/UserController.php @@ -2,7 +2,7 @@ namespace App\Api\v1\Controllers\Auth; -use App\User; +use App\Models\User; use App\Api\v1\Requests\UserUpdateRequest; use App\Api\v1\Resources\UserResource; use App\Http\Controllers\Controller; diff --git a/app/Api/v1/Controllers/GroupController.php b/app/Api/v1/Controllers/GroupController.php index 121d9be9..8bf54f81 100644 --- a/app/Api/v1/Controllers/GroupController.php +++ b/app/Api/v1/Controllers/GroupController.php @@ -2,7 +2,7 @@ namespace App\Api\v1\Controllers; -use App\Group; +use App\Models\Group; use App\Services\GroupService; use App\Api\v1\Requests\GroupStoreRequest; use App\Api\v1\Requests\GroupAssignRequest; @@ -64,7 +64,7 @@ class GroupController extends Controller /** * Display the specified resource. * - * @param \App\Group $group + * @param \App\Models\Group $group * @return \App\Api\v1\Resources\GroupResource */ public function show(Group $group) @@ -77,7 +77,7 @@ class GroupController extends Controller * Update the specified resource in storage. * * @param \App\Api\v1\Requests\GroupStoreRequest $request - * @param \App\Group $group + * @param \App\Models\Group $group * @return \App\Api\v1\Resources\GroupResource */ public function update(GroupStoreRequest $request, Group $group) @@ -95,7 +95,7 @@ class GroupController extends Controller * Associate the specified accounts with the group * * @param \App\Api\v1\Requests\GroupAssignRequest $request - * @param \App\Group $group + * @param \App\Models\Group $group * @return \App\Api\v1\Resources\GroupResource */ public function assignAccounts(GroupAssignRequest $request, Group $group) @@ -112,7 +112,7 @@ class GroupController extends Controller /** * Get accounts assign to the group * - * @param \App\Group $group + * @param \App\Models\Group $group * @return \App\Api\v1\Resources\TwoFAccountCollection */ public function accounts(Group $group) @@ -127,7 +127,7 @@ class GroupController extends Controller /** * Remove the specified resource from storage. * - * @param \App\Group $group + * @param \App\Models\Group $group * @return \Illuminate\Http\JsonResponse */ public function destroy(Group $group) diff --git a/app/Api/v1/Controllers/QrCodeController.php b/app/Api/v1/Controllers/QrCodeController.php index ffda4ac8..b4ec92b3 100644 --- a/app/Api/v1/Controllers/QrCodeController.php +++ b/app/Api/v1/Controllers/QrCodeController.php @@ -2,7 +2,7 @@ namespace App\Api\v1\Controllers; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Services\QrCodeService; use App\Services\TwoFAccountService; use App\Api\v1\Requests\QrCodeDecodeRequest; @@ -39,7 +39,7 @@ class QrCodeController extends Controller /** * Show a QR code image * - * @param App\TwoFAccount $twofaccount + * @param App\Models\TwoFAccount $twofaccount * @return \Illuminate\Http\JsonResponse */ public function show(TwoFAccount $twofaccount) diff --git a/app/Api/v1/Controllers/TwoFAccountController.php b/app/Api/v1/Controllers/TwoFAccountController.php index d84012a1..f565036c 100644 --- a/app/Api/v1/Controllers/TwoFAccountController.php +++ b/app/Api/v1/Controllers/TwoFAccountController.php @@ -2,7 +2,7 @@ namespace App\Api\v1\Controllers; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Exceptions\UndecipherableException; use App\Api\v1\Requests\TwoFAccountReorderRequest; use App\Api\v1\Requests\TwoFAccountStoreRequest; @@ -60,7 +60,7 @@ class TwoFAccountController extends Controller /** * Display a 2FA account * - * @param \App\TwoFAccount $twofaccount + * @param \App\Models\TwoFAccount $twofaccount * * @return \App\Api\v1\Resources\TwoFAccountReadResource */ @@ -104,7 +104,7 @@ class TwoFAccountController extends Controller * Update a 2FA account * * @param \App\Api\v1\Requests\TwoFAccountUpdateRequest $request - * @param \App\TwoFAccount $twofaccount + * @param \App\Models\TwoFAccount $twofaccount * @return \Illuminate\Http\JsonResponse */ public function update(TwoFAccountUpdateRequest $request, TwoFAccount $twofaccount) @@ -236,7 +236,7 @@ class TwoFAccountController extends Controller /** * Remove the specified resource from storage. * - * @param \App\TwoFAccount $twofaccount + * @param \App\Models\TwoFAccount $twofaccount * @return \Illuminate\Http\JsonResponse */ public function destroy(TwoFAccount $twofaccount) diff --git a/app/Console/Commands/Maintenance/FixUnsplittedAccounts.php b/app/Console/Commands/Maintenance/FixUnsplittedAccounts.php index d4976128..c05defa8 100644 --- a/app/Console/Commands/Maintenance/FixUnsplittedAccounts.php +++ b/app/Console/Commands/Maintenance/FixUnsplittedAccounts.php @@ -2,7 +2,7 @@ namespace App\Console\Commands\Maintenance; -use App\TwoFAccount; +use App\Models\TwoFAccount; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 473b0921..6d0166cc 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -7,15 +7,6 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; class Kernel extends ConsoleKernel { - /** - * The Artisan commands provided by your application. - * - * @var array - */ - protected $commands = [ - // - ]; - /** * Define the application's command schedule. * diff --git a/app/Events/GroupDeleting.php b/app/Events/GroupDeleting.php index 0b1ec504..0ae59820 100644 --- a/app/Events/GroupDeleting.php +++ b/app/Events/GroupDeleting.php @@ -2,7 +2,7 @@ namespace App\Events; -use App\Group; +use App\Models\Group; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; @@ -16,7 +16,7 @@ class GroupDeleting /** * Create a new event instance. * - * @param \App\Group $group + * @param \App\Models\Group $group * @return void */ public function __construct(Group $group) diff --git a/app/Events/TwoFAccountDeleted.php b/app/Events/TwoFAccountDeleted.php index e553f2ea..ada785fc 100644 --- a/app/Events/TwoFAccountDeleted.php +++ b/app/Events/TwoFAccountDeleted.php @@ -2,7 +2,7 @@ namespace App\Events; -use App\TwoFAccount; +use App\Models\TwoFAccount; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; @@ -16,7 +16,7 @@ class TwoFAccountDeleted /** * Create a new event instance. * - * @param \App\TwoFAccount $twofaccount + * @param \App\Models\TwoFAccount $twofaccount * @return void */ public function __construct(TwoFAccount $twofaccount) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 15e74567..654510d1 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -11,7 +11,7 @@ class Handler extends ExceptionHandler /** * A list of the exception types that are not reported. * - * @var array + * @var string[] */ protected $dontReport = [ // @@ -20,62 +20,50 @@ class Handler extends ExceptionHandler /** * A list of the inputs that are never flashed for validation exceptions. * - * @var array + * @var string[] */ protected $dontFlash = [ + 'current_password', 'password', 'password_confirmation', ]; /** - * Report or log an exception. + * Register the exception handling callbacks for the application. * - * @param \Throwable $exception * @return void */ - public function report(Throwable $exception) + public function register() { - parent::report($exception); - } + // $this->reportable(function (Throwable $e) { + // + // }); - /** - * Render an exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @param \Throwable $exception - * @return \Symfony\Component\HttpFoundation\Response - * - * @throws \Throwable - */ - public function render($request, Throwable $exception) - { - if ($exception instanceof ModelNotFoundException) { - return response()->json([ - 'message' => str_replace('App\\', '', $exception->getModel()).' not found'], 404); - } - if ($exception instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException) { + $this->renderable(function (\Symfony\Component\HttpKernel\Exception\NotFoundHttpException $exception, $request) { return response()->json([ 'message' => 'not found'], 404); - } - if ($exception instanceof InvalidOtpParameterException) { + }); + + $this->renderable(function (InvalidOtpParameterException $exception, $request) { return response()->json([ 'message' => 'invalid OTP parameters', 'reason' => [$exception->getMessage()] ], 400); - } - if ($exception instanceof InvalidQrCodeException) { + }); + + $this->renderable(function (InvalidQrCodeException $exception, $request) { return response()->json([ 'message' => 'not a valid QR code'], 400); - } - if ($exception instanceof InvalidSecretException) { + }); + + $this->renderable(function (InvalidSecretException $exception, $request) { return response()->json([ 'message' => 'not a valid base32 encoded secret'], 400); - } - if ($exception instanceof DbEncryptionException) { + }); + + $this->renderable(function (DbEncryptionException $exception, $request) { return response()->json([ 'message' => $exception->getMessage()], 400); - } - - return parent::render($request, $exception); + }); } } \ No newline at end of file diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 8df21353..5151c346 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -14,12 +14,13 @@ class Kernel extends HttpKernel * @var array */ protected $middleware = [ - \App\Http\Middleware\CheckForMaintenanceMode::class, + \App\Http\Middleware\TrustProxies::class, + \Fruitcake\Cors\HandleCors::class, + // \App\Http\Middleware\CheckForMaintenanceMode::class, + \App\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, \App\Http\Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - \App\Http\Middleware\TrustProxies::class, - \Fruitcake\Cors\HandleCors::class, \App\Http\Middleware\SetLanguage::class, \App\Http\Middleware\ForceJsonResponse::class, ]; @@ -42,8 +43,8 @@ class Kernel extends HttpKernel ], 'api.v1' => [ - 'throttle:60,1', - 'bindings', + 'throttle:api', + \Illuminate\Routing\Middleware\SubstituteBindings::class, \App\Http\Middleware\KickOutInactiveUser::class, \App\Http\Middleware\LogUserLastSeen::class, ], @@ -59,10 +60,10 @@ class Kernel extends HttpKernel protected $routeMiddleware = [ 'auth' => \App\Http\Middleware\Authenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, - 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, + 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, diff --git a/app/Http/Middleware/KickOutInactiveUser.php b/app/Http/Middleware/KickOutInactiveUser.php index e8268273..c052b557 100644 --- a/app/Http/Middleware/KickOutInactiveUser.php +++ b/app/Http/Middleware/KickOutInactiveUser.php @@ -3,7 +3,7 @@ namespace App\Http\Middleware; use Closure; -use App\User; +use App\Models\User; use Carbon\Carbon; use Illuminate\Http\Response; use Illuminate\Support\Facades\Auth; diff --git a/app/Http/Middleware/CheckForMaintenanceMode.php b/app/Http/Middleware/PreventRequestsDuringMaintenance.php similarity index 57% rename from app/Http/Middleware/CheckForMaintenanceMode.php rename to app/Http/Middleware/PreventRequestsDuringMaintenance.php index 35b9824b..2edcdfea 100644 --- a/app/Http/Middleware/CheckForMaintenanceMode.php +++ b/app/Http/Middleware/PreventRequestsDuringMaintenance.php @@ -2,9 +2,9 @@ namespace App\Http\Middleware; -use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware; +use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware; -class CheckForMaintenanceMode extends Middleware +class PreventRequestsDuringMaintenance extends Middleware { /** * The URIs that should be reachable while maintenance mode is enabled. @@ -14,4 +14,4 @@ class CheckForMaintenanceMode extends Middleware protected $except = [ // ]; -} +} \ No newline at end of file diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e3a4beef..b8705d93 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -2,7 +2,9 @@ namespace App\Http\Middleware; +use App\Providers\RouteServiceProvider; use Closure; +use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; class RedirectIfAuthenticated @@ -12,13 +14,17 @@ class RedirectIfAuthenticated * * @param \Illuminate\Http\Request $request * @param \Closure $next - * @param string|null $guard + * @param string|null ...$guards * @return mixed */ - public function handle($request, Closure $next, $guard = null) + public function handle(Request $request, Closure $next, ...$guards) { - if (Auth::guard($guard)->check()) { - return response()->json(['message' => __('auth.already_authenticated')], 400); + $guards = empty($guards) ? [null] : $guards; + + foreach ($guards as $guard) { + if (Auth::guard($guard)->check()) { + return response()->json(['message' => __('auth.already_authenticated')], 400); + } } return $next($request); diff --git a/app/Http/Middleware/TrimStrings.php b/app/Http/Middleware/TrimStrings.php index 5a50e7b5..a8a252df 100644 --- a/app/Http/Middleware/TrimStrings.php +++ b/app/Http/Middleware/TrimStrings.php @@ -12,6 +12,7 @@ class TrimStrings extends Middleware * @var array */ protected $except = [ + 'current_password', 'password', 'password_confirmation', ]; diff --git a/app/Http/Middleware/TrustProxies.php b/app/Http/Middleware/TrustProxies.php index 12fdf8b5..e29237d3 100644 --- a/app/Http/Middleware/TrustProxies.php +++ b/app/Http/Middleware/TrustProxies.php @@ -2,15 +2,15 @@ namespace App\Http\Middleware; +use Illuminate\Http\Middleware\TrustProxies as Middleware; use Illuminate\Http\Request; -use Fideloper\Proxy\TrustProxies as Middleware; class TrustProxies extends Middleware { /** * The trusted proxies for this application. * - * @var array|string + * @var array|string|null */ protected $proxies; @@ -19,5 +19,10 @@ 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; +} \ No newline at end of file diff --git a/app/Listeners/DissociateTwofaccountFromGroup.php b/app/Listeners/DissociateTwofaccountFromGroup.php index 3e2d6589..884b56f2 100644 --- a/app/Listeners/DissociateTwofaccountFromGroup.php +++ b/app/Listeners/DissociateTwofaccountFromGroup.php @@ -2,7 +2,7 @@ namespace App\Listeners; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Events\GroupDeleting; use Illuminate\Support\Facades\Log; diff --git a/app/Group.php b/app/Models/Group.php similarity index 89% rename from app/Group.php rename to app/Models/Group.php index 3893f5a6..15ccfca4 100644 --- a/app/Group.php +++ b/app/Models/Group.php @@ -1,14 +1,17 @@ hasMany('App\TwoFAccount'); + return $this->hasMany('App\Models\TwoFAccount'); } } diff --git a/app/Option.php b/app/Models/Option.php similarity index 95% rename from app/Option.php rename to app/Models/Option.php index ca925dd6..4de3c62d 100644 --- a/app/Option.php +++ b/app/Models/Option.php @@ -1,6 +1,6 @@ 'App\Policies\ModelPolicy', + // 'App\Models\Model' => 'App\Policies\ModelPolicy', ]; /** diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 11285241..4d973ff8 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -33,8 +33,6 @@ class EventServiceProvider extends ServiceProvider */ public function boot() { - parent::boot(); - // } } diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 88af9fda..d9db0852 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -2,18 +2,30 @@ namespace App\Providers; -use Illuminate\Support\Facades\Route; +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 { /** - * This namespace is applied to your controller routes. + * The path to the "home" route for your application. * - * In addition, it is set as the URL generator's root namespace. + * This is used by Laravel authentication to redirect users after login. * * @var string */ + public const HOME = '/accounts'; + + /** + * The controller namespace for the application. + * + * When present, controller route declarations will automatically be prefixed with this namespace. + * + * @var string|null + */ protected $namespace = 'App\Http\Controllers'; /** @@ -24,68 +36,25 @@ class RouteServiceProvider extends ServiceProvider public function boot() { Route::pattern('settingName', '[a-zA-Z]+'); + $this->configureRateLimiting(); - parent::boot(); + $this->routes(function () { + Route::prefix('api/v1') + ->middleware('api.v1') + ->namespace($this->getApiNamespace(1)) + ->group(base_path('routes/api/v1.php')); + + // Route::prefix('api/v2') + // ->middleware('api.v2') + // ->namespace($this->getApiNamespace(2)) + // ->group(base_path('routes/api/v2.php')); + + Route::middleware('web') + ->namespace($this->namespace) + ->group(base_path('routes/web.php')); + }); } - /** - * Define the routes for the application. - * - * @return void - */ - public function map() - { - $this->mapApiVersionOneRoutes(); - - // $this->mapApiVersionTwoRoutes(); - - $this->mapWebRoutes(); - } - - /** - * Define the "web" routes for the application. - * - * These routes all receive session state, CSRF protection, etc. - * - * @return void - */ - protected function mapWebRoutes() - { - Route::middleware('web') - ->namespace($this->namespace) - ->group(base_path('routes/web.php')); - } - - /** - * Define the "v1 api" routes for the application. - * - * These routes are typically stateless. - * - * @return void - */ - protected function mapApiVersionOneRoutes() - { - Route::prefix('api/v1') - ->middleware('api.v1') - ->namespace($this->getApiNamespace(1)) - ->group(base_path('routes/api/v1.php')); - } - - /** - * Define the "v2 api" routes for the application. - * - * These routes are typically stateless. - * - * @return void - */ - // protected function mapApiVersionTwoRoutes() - // { - // Route::prefix('api/v2') - // ->middleware('api.v2') - // ->namespace($this->getApiNamespace(2)) - // ->group(base_path('routes/api/v2.php')); - // } - /** * Build Api namespace based on provided version * @@ -95,4 +64,16 @@ class RouteServiceProvider extends ServiceProvider { return 'App\Api\v' . $version . '\Controllers'; } + + /** + * Configure the rate limiters for the application. + * + * @return void + */ + protected function configureRateLimiting() + { + RateLimiter::for('api', function (Request $request) { + return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); + }); + } } diff --git a/app/Services/GroupService.php b/app/Services/GroupService.php index 3a576061..795ada1d 100644 --- a/app/Services/GroupService.php +++ b/app/Services/GroupService.php @@ -2,8 +2,8 @@ namespace App\Services; -use App\Group; -use App\TwoFAccount; +use App\Models\Group; +use App\Models\TwoFAccount; use App\Services\SettingService; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Log; @@ -59,7 +59,7 @@ class GroupService * Creates a group * * @param array $data - * @return \App\Group The created group + * @return \App\Models\Group The created group */ public function create(array $data) : Group { @@ -78,9 +78,9 @@ class GroupService /** * Updates a group using a list of parameters * - * @param \App\Group $group The group + * @param \App\Models\Group $group The group * @param array $data The parameters - * @return \App\Group The updated group + * @return \App\Models\Group The updated group */ public function update(Group $group, array $data) : Group { @@ -133,7 +133,7 @@ class GroupService * Assign one or more accounts to a group * * @param array|int $ids accounts ids to assign - * @param \App\Group $group The target group + * @param \App\Models\Group $group The target group * @return void */ public function assign($ids, Group $group = null) : void @@ -162,7 +162,7 @@ class GroupService /** * Finds twofaccounts assigned to the group * - * @param \App\Group $group The group + * @param \App\Models\Group $group The group * @return Collection The assigned accounts */ public function getAccounts(Group $group) : Collection @@ -176,7 +176,7 @@ class GroupService /** * Determines the destination group * - * @return \App\Group|null The group or null if it does not exist + * @return \App\Models\Group|null The group or null if it does not exist */ private function defaultGroup() { diff --git a/app/Services/QrCodeService.php b/app/Services/QrCodeService.php index 1865c1db..be790e3f 100644 --- a/app/Services/QrCodeService.php +++ b/app/Services/QrCodeService.php @@ -2,7 +2,7 @@ namespace App\Services; -use App\TwoFAccount; +use App\Models\TwoFAccount; use Zxing\QrReader; use Illuminate\Support\Facades\Storage; use Illuminate\Support\Facades\Log; diff --git a/app/Services/SettingService.php b/app/Services/SettingService.php index 81f56b2e..6f9e9b63 100644 --- a/app/Services/SettingService.php +++ b/app/Services/SettingService.php @@ -4,7 +4,7 @@ namespace App\Services; use Throwable; use Exception; -use App\Option; +use App\Models\Option; use Illuminate\Support\Collection; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; diff --git a/app/Services/TwoFAccountService.php b/app/Services/TwoFAccountService.php index 53135289..9d9005fc 100644 --- a/app/Services/TwoFAccountService.php +++ b/app/Services/TwoFAccountService.php @@ -2,7 +2,7 @@ namespace App\Services; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Exceptions\InvalidSecretException; use App\Exceptions\InvalidOtpParameterException; use App\Exceptions\UndecipherableException; @@ -48,7 +48,7 @@ class TwoFAccountService * @param string $uri * @param bool $saveToDB Whether or not the created account should be saved to DB * - * @return \App\TwoFAccount The created account + * @return \App\Models\TwoFAccount The created account */ public function createFromUri(string $uri, bool $saveToDB = true ) : TwoFAccount { @@ -76,7 +76,7 @@ class TwoFAccountService * @param array $data * @param bool $saveToDB Whether or not the created account should be saved to DB * - * @return \App\TwoFAccount The created account + * @return \App\Models\TwoFAccount The created account */ public function createFromParameters(array $data, bool $saveToDB = true) : TwoFAccount { @@ -102,10 +102,10 @@ class TwoFAccountService /** * Updates an account using a list of parameters * - * @param \App\TwoFAccount $twofaccount The account + * @param \App\Models\TwoFAccount $twofaccount The account * @param array $data The parameters * - * @return \App\TwoFAccount The updated account + * @return \App\Models\TwoFAccount The updated account */ public function update(TwoFAccount $twofaccount, array $data) : TwoFAccount { @@ -125,7 +125,7 @@ class TwoFAccountService /** * Returns a One-Time Password (with its parameters) for the specified account * - * @param \App\TwoFAccount|TwoFAccountDto|int|string $data Data defining an account + * @param \App\Models\TwoFAccount|TwoFAccountDto|int|string $data Data defining an account * * @return OtpDto an OTP DTO * @@ -176,7 +176,7 @@ class TwoFAccountService /** * Returns a generated otpauth URI for the specified account * - * @param \App\TwoFAccount|TwoFAccountDto|int $data Data defining an account + * @param \App\Models\TwoFAccount|TwoFAccountDto|int $data Data defining an account */ public function getURI($data) : string { @@ -254,7 +254,7 @@ class TwoFAccountService private function initTokenWith($data) : void { // init with a TwoFAccount instance - if ( is_object($data) && get_class($data) === 'App\TwoFAccount' ) { + if ( is_object($data) && get_class($data) === 'App\Models\TwoFAccount' ) { $this->initTokenWithTwoFAccount($data); } // init with a TwoFAccountDto instance @@ -307,7 +307,7 @@ class TwoFAccountService /** * Instanciates the token with a TwoFAccount * - * @param \App\TwoFAccount $twofaccount + * @param \App\Models\TwoFAccount $twofaccount * * @param bool $usingUri Whether or not the token should be fed with the account uri */ diff --git a/composer.json b/composer.json index f99c51a2..bce93c7b 100644 --- a/composer.json +++ b/composer.json @@ -8,25 +8,25 @@ ], "license": "MIT", "require": { - "php": "^7.4", - "chillerlan/php-qrcode": "^4.3", - "doctrine/dbal": "^2.10", - "fakerphp/faker": "^1.16", - "fideloper/proxy": "^4.4.1", + "php": "^7.4|^8.0", "fruitcake/laravel-cors": "^2.0", - "khanamiryan/qrcode-detector-decoder": "^1.0.4", - "laravel/framework": "^7.0", - "laravel/passport": "^9.3.2", - "laravel/tinker": "^2.0", - "laravel/ui": "^2.0", + "guzzlehttp/guzzle": "^7.0.1", + "laravel/framework": "^8.0", + "laravel/passport": "^10.0", + "laravel/tinker": "^2.5", + "laravel/ui": "^3.0", + "chillerlan/php-qrcode": "^4.3", + "doctrine/dbal": "^3.2", + "khanamiryan/qrcode-detector-decoder": "^1.0.5", "paragonie/constant_time_encoding": "^2.4", "spatie/eloquent-sortable": "^3.11", "spomky-labs/otphp": "^10.0" }, "require-dev": { - "facade/ignition": "^2.3", + "facade/ignition": "^2.3.6", + "fakerphp/faker": "^1.16", "mockery/mockery": "^1.3", - "nunomaduro/collision": "^4.1", + "nunomaduro/collision": "^5.0", "phpunit/phpunit": "^9.5" }, "config": { @@ -41,12 +41,10 @@ }, "autoload": { "psr-4": { - "App\\": "app/" - }, - "classmap": [ - "database/seeds", - "database/factories" - ] + "App\\": "app/", + "Database\\Factories\\": "database/factories/", + "Database\\Seeders\\": "database/seeders/" + } }, "autoload-dev": { "psr-4": { diff --git a/composer.lock b/composer.lock index e8caeec7..387963e3 100644 --- a/composer.lock +++ b/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": "164610e955dcc10d37c0c9ce4f37aca4", + "content-hash": "716fb4fa2073f1dca8972fd6128c60e2", "packages": [ { "name": "asm89/stack-cors", @@ -330,6 +330,79 @@ ], "time": "2021-09-06T15:17:01+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "1.11.99.4", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "b174585d1fe49ceed21928a945138948cb394600" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", + "reference": "b174585d1fe49ceed21928a945138948cb394600", + "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.4" + }, + "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-09-13T08:41:34+00:00" + }, { "name": "defuse/php-encryption", "version": "v2.3.1", @@ -396,6 +469,81 @@ }, "time": "2021-04-09T23:57:26+00:00" }, + { + "name": "dflydev/dot-access-data", + "version": "v3.0.1", + "source": { + "type": "git", + "url": "https://github.com/dflydev/dflydev-dot-access-data.git", + "reference": "0992cc19268b259a39e86f296da5f0677841f42c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dflydev/dflydev-dot-access-data/zipball/0992cc19268b259a39e86f296da5f0677841f42c", + "reference": "0992cc19268b259a39e86f296da5f0677841f42c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.42", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.3", + "scrutinizer/ocular": "1.6.0", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^3.14" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dflydev\\DotAccessData\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dragonfly Development Inc.", + "email": "info@dflydev.com", + "homepage": "http://dflydev.com" + }, + { + "name": "Beau Simensen", + "email": "beau@dflydev.com", + "homepage": "http://beausimensen.com" + }, + { + "name": "Carlos Frutos", + "email": "carlos@kiwing.it", + "homepage": "https://github.com/cfrutos" + }, + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com" + } + ], + "description": "Given a deep data structure, access data by dot notation.", + "homepage": "https://github.com/dflydev/dflydev-dot-access-data", + "keywords": [ + "access", + "data", + "dot", + "notation" + ], + "support": { + "issues": "https://github.com/dflydev/dflydev-dot-access-data/issues", + "source": "https://github.com/dflydev/dflydev-dot-access-data/tree/v3.0.1" + }, + "time": "2021-08-13T13:06:58+00:00" + }, { "name": "doctrine/cache", "version": "2.1.1", @@ -497,34 +645,37 @@ }, { "name": "doctrine/dbal", - "version": "2.13.6", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f" + "reference": "5d54f63541d7bed1156cb5c9b79274ced61890e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/67ef6d0327ccbab1202b39e0222977a47ed3ef2f", - "reference": "67ef6d0327ccbab1202b39e0222977a47ed3ef2f", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/5d54f63541d7bed1156cb5c9b79274ced61890e4", + "reference": "5d54f63541d7bed1156cb5c9b79274ced61890e4", "shasum": "" }, "require": { - "doctrine/cache": "^1.0|^2.0", + "composer/package-versions-deprecated": "^1.11.99", + "doctrine/cache": "^1.11|^2.0", "doctrine/deprecations": "^0.5.3", "doctrine/event-manager": "^1.0", - "ext-pdo": "*", - "php": "^7.1 || ^8" + "php": "^7.3 || ^8.0", + "psr/cache": "^1|^2|^3", + "psr/log": "^1|^2|^3" }, "require-dev": { "doctrine/coding-standard": "9.0.0", "jetbrains/phpstorm-stubs": "2021.1", "phpstan/phpstan": "1.2.0", - "phpunit/phpunit": "^7.5.20|^8.5|9.5.10", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "9.5.10", "psalm/plugin-phpunit": "0.16.1", "squizlabs/php_codesniffer": "3.6.1", - "symfony/cache": "^4.4", - "symfony/console": "^2.0.5|^3.0|^4.0|^5.0", + "symfony/cache": "^5.2|^6.0", + "symfony/console": "^2.0.5|^3.0|^4.0|^5.0|^6.0", "vimeo/psalm": "4.13.0" }, "suggest": { @@ -536,7 +687,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\DBAL\\": "lib/Doctrine/DBAL" + "Doctrine\\DBAL\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -579,14 +730,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.6" + "source": "https://github.com/doctrine/dbal/tree/3.2.0" }, "funding": [ { @@ -602,7 +752,7 @@ "type": "tidelift" } ], - "time": "2021-11-26T20:11:05+00:00" + "time": "2021-11-26T21:00:12+00:00" }, { "name": "doctrine/deprecations", @@ -914,30 +1064,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/" @@ -948,11 +1100,6 @@ "MIT" ], "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, { "name": "Chris Tankersley", "email": "chris@ctankersley.com", @@ -966,7 +1113,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": [ { @@ -974,7 +1121,7 @@ "type": "github" } ], - "time": "2020-10-13T00:52:37+00:00" + "time": "2020-11-24T19:55:57+00:00" }, { "name": "egulias/email-validator", @@ -1044,129 +1191,6 @@ ], "time": "2020-12-29T14:50:06+00:00" }, - { - "name": "fakerphp/faker", - "version": "v1.16.0", - "source": { - "type": "git", - "url": "https://github.com/FakerPHP/Faker.git", - "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/271d384d216e5e5c468a6b28feedf95d49f83b35", - "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "psr/container": "^1.0 || ^2.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.16-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/v1.16.0" - }, - "time": "2021-09-06T14:53:37+00:00" - }, - { - "name": "fideloper/proxy", - "version": "4.4.1", - "source": { - "type": "git", - "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/c073b2bd04d1c90e04dc1b787662b558dd65ade0", - "reference": "c073b2bd04d1c90e04dc1b787662b558dd65ade0", - "shasum": "" - }, - "require": { - "illuminate/contracts": "^5.0|^6.0|^7.0|^8.0|^9.0", - "php": ">=5.4.0" - }, - "require-dev": { - "illuminate/http": "^5.0|^6.0|^7.0|^8.0|^9.0", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Fideloper\\Proxy\\TrustedProxyServiceProvider" - ] - } - }, - "autoload": { - "psr-4": { - "Fideloper\\Proxy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Chris Fidao", - "email": "fideloper@gmail.com" - } - ], - "description": "Set trusted proxies for Laravel", - "keywords": [ - "load balancing", - "proxy", - "trusted proxy" - ], - "support": { - "issues": "https://github.com/fideloper/TrustedProxy/issues", - "source": "https://github.com/fideloper/TrustedProxy/tree/4.4.1" - }, - "time": "2020-10-22T13:48:01+00:00" - }, { "name": "firebase/php-jwt", "version": "v5.5.1", @@ -1301,6 +1325,391 @@ ], "time": "2021-04-26T11:24:25+00:00" }, + { + "name": "graham-campbell/result-type", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/GrahamCampbell/Result-Type.git", + "reference": "0690bde05318336c7221785f2a932467f98b64ca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/0690bde05318336c7221785f2a932467f98b64ca", + "reference": "0690bde05318336c7221785f2a932467f98b64ca", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "phpoption/phpoption": "^1.8" + }, + "require-dev": { + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.5.8" + }, + "type": "library", + "autoload": { + "psr-4": { + "GrahamCampbell\\ResultType\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + } + ], + "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.4" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", + "type": "tidelift" + } + ], + "time": "2021-11-21T21:41:47+00:00" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.4.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/868b3571a039f0ebc11ac8f344f4080babe2cb94", + "reference": "868b3571a039f0ebc11ac8f344f4080babe2cb94", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5", + "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "ext-curl": "*", + "php-http/client-integration-tests": "^3.0", + "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "7.4-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.4.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2021-10-18T09:52:00+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "1.5.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4 || ^5.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2021-10-22T20:56:57+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.8 || ^9.3.10" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.1.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2021-10-06T17:43:30+00:00" + }, { "name": "khanamiryan/qrcode-detector-decoder", "version": "1.0.5.2", @@ -1356,161 +1765,65 @@ }, "time": "2021-07-13T18:46:38+00:00" }, - { - "name": "laminas/laminas-diactoros", - "version": "2.8.0", - "source": { - "type": "git", - "url": "https://github.com/laminas/laminas-diactoros.git", - "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/0c26ef1d95b6d7e6e3943a243ba3dc0797227199", - "reference": "0c26ef1d95b6d7e6e3943a243ba3dc0797227199", - "shasum": "" - }, - "require": { - "php": "^7.3 || ~8.0.0 || ~8.1.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" - }, - "conflict": { - "phpspec/prophecy": "<1.9.0", - "zendframework/zend-diactoros": "*" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-curl": "*", - "ext-dom": "*", - "ext-gd": "*", - "ext-libxml": "*", - "http-interop/http-factory-tests": "^0.8.0", - "laminas/laminas-coding-standard": "~1.0.0", - "php-http/psr7-integration-tests": "^1.1", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.1", - "psalm/plugin-phpunit": "^0.14.0", - "vimeo/psalm": "^4.3" - }, - "type": "library", - "extra": { - "laminas": { - "config-provider": "Laminas\\Diactoros\\ConfigProvider", - "module": "Laminas\\Diactoros" - } - }, - "autoload": { - "files": [ - "src/functions/create_uploaded_file.php", - "src/functions/marshal_headers_from_sapi.php", - "src/functions/marshal_method_from_sapi.php", - "src/functions/marshal_protocol_version_from_sapi.php", - "src/functions/marshal_uri_from_sapi.php", - "src/functions/normalize_server.php", - "src/functions/normalize_uploaded_files.php", - "src/functions/parse_cookie_header.php", - "src/functions/create_uploaded_file.legacy.php", - "src/functions/marshal_headers_from_sapi.legacy.php", - "src/functions/marshal_method_from_sapi.legacy.php", - "src/functions/marshal_protocol_version_from_sapi.legacy.php", - "src/functions/marshal_uri_from_sapi.legacy.php", - "src/functions/normalize_server.legacy.php", - "src/functions/normalize_uploaded_files.legacy.php", - "src/functions/parse_cookie_header.legacy.php" - ], - "psr-4": { - "Laminas\\Diactoros\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "PSR HTTP Message implementations", - "homepage": "https://laminas.dev", - "keywords": [ - "http", - "laminas", - "psr", - "psr-17", - "psr-7" - ], - "support": { - "chat": "https://laminas.dev/chat", - "docs": "https://docs.laminas.dev/laminas-diactoros/", - "forum": "https://discourse.laminas.dev", - "issues": "https://github.com/laminas/laminas-diactoros/issues", - "rss": "https://github.com/laminas/laminas-diactoros/releases.atom", - "source": "https://github.com/laminas/laminas-diactoros" - }, - "funding": [ - { - "url": "https://funding.communitybridge.org/projects/laminas-project", - "type": "community_bridge" - } - ], - "time": "2021-09-22T03:54:36+00:00" - }, { "name": "laravel/framework", - "version": "v7.30.5", + "version": "v8.74.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "afb0c034072a03a5ab1872fbdea54f8befd873c3" + "reference": "004ea195012d5132eca07a176a6e587c6a74815e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/afb0c034072a03a5ab1872fbdea54f8befd873c3", - "reference": "afb0c034072a03a5ab1872fbdea54f8befd873c3", + "url": "https://api.github.com/repos/laravel/framework/zipball/004ea195012d5132eca07a176a6e587c6a74815e", + "reference": "004ea195012d5132eca07a176a6e587c6a74815e", "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": "*", "ext-openssl": "*", - "league/commonmark": "^1.3", + "laravel/serializable-closure": "^1.0", + "league/commonmark": "^1.3|^2.0.2", "league/flysystem": "^1.1", "monolog/monolog": "^2.0", - "nesbot/carbon": "^2.31", + "nesbot/carbon": "^2.53.1", "opis/closure": "^3.6", - "php": "^7.2.5|^8.0", + "php": "^7.3|^8.0", "psr/container": "^1.0", + "psr/log": "^1.0 || ^2.0", "psr/simple-cache": "^1.0", - "ramsey/uuid": "^3.7|^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", + "ramsey/uuid": "^4.2.2", + "swiftmailer/swiftmailer": "^6.3", + "symfony/console": "^5.4", + "symfony/error-handler": "^5.4", + "symfony/finder": "^5.4", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/mime": "^5.4", + "symfony/process": "^5.4", + "symfony/routing": "^5.4", + "symfony/var-dumper": "^5.4", "tijsverkoyen/css-to-inline-styles": "^2.2.2", - "vlucas/phpdotenv": "^4.0", + "vlucas/phpdotenv": "^5.2", "voku/portable-ascii": "^1.4.8" }, "conflict": { "tightenco/collect": "<5.5.33" }, "provide": { - "psr/container-implementation": "1.0" + "psr/container-implementation": "1.0", + "psr/simple-cache-implementation": "1.0" }, "replace": { "illuminate/auth": "self.version", "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", @@ -1523,6 +1836,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", @@ -1538,22 +1852,23 @@ "illuminate/view": "self.version" }, "require-dev": { - "aws/aws-sdk-php": "^3.155", - "doctrine/dbal": "^2.6", - "filp/whoops": "^2.8", - "guzzlehttp/guzzle": "^6.3.1|^7.0.1", + "aws/aws-sdk-php": "^3.198.1", + "doctrine/dbal": "^2.13.3|^3.1.4", + "filp/whoops": "^2.14.3", + "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.4", + "orchestra/testbench-core": "^6.27", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.4|^9.3.3", - "predis/predis": "^1.1.1", - "symfony/cache": "^5.0" + "phpunit/phpunit": "^8.5.19|^9.5.8", + "predis/predis": "^1.1.9", + "symfony/cache": "^5.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).", + "aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).", + "brianium/paratest": "Required to run tests in parallel (^6.0).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", + "ext-bcmath": "Required to use the multiple_of validation rule.", "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.", @@ -1561,38 +1876,43 @@ "ext-posix": "Required to use all features of the queue worker.", "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).", + "filp/whoops": "Required for friendly error pages in development (^2.14.3).", + "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.4).", "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).", - "predis/predis": "Required to use the predis connector (^1.1.2).", + "phpunit/phpunit": "Required to use assertions and run tests (^8.5.19|^9.5.8).", + "predis/predis": "Required to use the predis connector (^1.1.9).", "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|^6.0|^7.0).", + "symfony/cache": "Required to PSR-6 cache bridge (^5.4).", + "symfony/filesystem": "Required to enable support for relative symbolic links (^5.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/", @@ -1615,51 +1935,50 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2021-11-17T15:00:14+00:00" + "time": "2021-11-30T15:26:05+00:00" }, { "name": "laravel/passport", - "version": "v9.4.0", + "version": "v10.2.0", "source": { "type": "git", "url": "https://github.com/laravel/passport.git", - "reference": "011bd500e8ae3d459b692467880a49ff1ecd60c0" + "reference": "1c69a010930a3ce8db348967d8ad9585be4d7d4d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/passport/zipball/011bd500e8ae3d459b692467880a49ff1ecd60c0", - "reference": "011bd500e8ae3d459b692467880a49ff1ecd60c0", + "url": "https://api.github.com/repos/laravel/passport/zipball/1c69a010930a3ce8db348967d8ad9585be4d7d4d", + "reference": "1c69a010930a3ce8db348967d8ad9585be4d7d4d", "shasum": "" }, "require": { "ext-json": "*", "firebase/php-jwt": "^5.0", - "illuminate/auth": "^6.18.31|^7.22.4", - "illuminate/console": "^6.18.31|^7.22.4", - "illuminate/container": "^6.18.31|^7.22.4", - "illuminate/contracts": "^6.18.31|^7.22.4", - "illuminate/cookie": "^6.18.31|^7.22.4", - "illuminate/database": "^6.18.31|^7.22.4", - "illuminate/encryption": "^6.18.31|^7.22.4", - "illuminate/http": "^6.18.31|^7.22.4", - "illuminate/support": "^6.18.31|^7.22.4", - "laminas/laminas-diactoros": "^2.2", + "illuminate/auth": "^8.2", + "illuminate/console": "^8.2", + "illuminate/container": "^8.2", + "illuminate/contracts": "^8.2", + "illuminate/cookie": "^8.2", + "illuminate/database": "^8.2", + "illuminate/encryption": "^8.2", + "illuminate/http": "^8.2", + "illuminate/support": "^8.2", "lcobucci/jwt": "^3.4|^4.0", - "league/oauth2-server": "^8.2.3", - "nyholm/psr7": "^1.0", - "php": "^7.2|^8.0", - "phpseclib/phpseclib": "^2.0", + "league/oauth2-server": "^8.2", + "nyholm/psr7": "^1.3", + "php": "^7.3|^8.0", + "phpseclib/phpseclib": "^2.0|^3.0", "symfony/psr-http-message-bridge": "^2.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/testbench": "^4.4|^5.0", - "phpunit/phpunit": "^8.5|^9.3" + "orchestra/testbench": "^6.0", + "phpunit/phpunit": "^9.3" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "9.x-dev" + "dev-master": "10.x-dev" }, "laravel": { "providers": [ @@ -1669,7 +1988,8 @@ }, "autoload": { "psr-4": { - "Laravel\\Passport\\": "src/" + "Laravel\\Passport\\": "src/", + "Laravel\\Passport\\Database\\Factories\\": "database/factories/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1692,7 +2012,66 @@ "issues": "https://github.com/laravel/passport/issues", "source": "https://github.com/laravel/passport" }, - "time": "2020-12-04T09:37:12+00:00" + "time": "2021-11-02T16:45:51+00:00" + }, + { + "name": "laravel/serializable-closure", + "version": "v1.0.5", + "source": { + "type": "git", + "url": "https://github.com/laravel/serializable-closure.git", + "reference": "25de3be1bca1b17d52ff0dc02b646c667ac7266c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/25de3be1bca1b17d52ff0dc02b646c667ac7266c", + "reference": "25de3be1bca1b17d52ff0dc02b646c667ac7266c", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "pestphp/pest": "^1.18", + "phpstan/phpstan": "^0.12.98", + "symfony/var-dumper": "^5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Laravel\\SerializableClosure\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + }, + { + "name": "Nuno Maduro", + "email": "nuno@laravel.com" + } + ], + "description": "Laravel Serializable Closure provides an easy and secure way to serialize closures in PHP.", + "keywords": [ + "closure", + "laravel", + "serializable" + ], + "support": { + "issues": "https://github.com/laravel/serializable-closure/issues", + "source": "https://github.com/laravel/serializable-closure" + }, + "time": "2021-11-30T15:53:04+00:00" }, { "name": "laravel/tinker", @@ -1764,26 +2143,33 @@ }, { "name": "laravel/ui", - "version": "v2.5.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/laravel/ui.git", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d" + "reference": "b3e804559bf3973ecca160a4ae1068e6c7c167c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/ui/zipball/d01a705763c243b07be795e9d1bb47f89260f73d", - "reference": "d01a705763c243b07be795e9d1bb47f89260f73d", + "url": "https://api.github.com/repos/laravel/ui/zipball/b3e804559bf3973ecca160a4ae1068e6c7c167c6", + "reference": "b3e804559bf3973ecca160a4ae1068e6c7c167c6", "shasum": "" }, "require": { - "illuminate/console": "^7.0", - "illuminate/filesystem": "^7.0", - "illuminate/support": "^7.0", - "php": "^7.2.5|^8.0" + "illuminate/console": "^8.42|^9.0", + "illuminate/filesystem": "^8.42|^9.0", + "illuminate/support": "^8.42|^9.0", + "illuminate/validation": "^8.42|^9.0", + "php": "^7.3|^8.0" + }, + "require-dev": { + "orchestra/testbench": "^6.23|^7.0" }, "type": "library", "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, "laravel": { "providers": [ "Laravel\\Ui\\UiServiceProvider" @@ -1812,10 +2198,9 @@ "ui" ], "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.4.0" }, - "time": "2020-11-03T19:45:19+00:00" + "time": "2021-11-30T16:22:00+00:00" }, { "name": "lcobucci/clock", @@ -1954,42 +2339,51 @@ }, { "name": "league/commonmark", - "version": "1.6.6", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "c4228d11e30d7493c6836d20872f9582d8ba6dcf" + "reference": "2df87709f44b0dd733df86aef0830dce9b1f0f13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/c4228d11e30d7493c6836d20872f9582d8ba6dcf", - "reference": "c4228d11e30d7493c6836d20872f9582d8ba6dcf", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/2df87709f44b0dd733df86aef0830dce9b1f0f13", + "reference": "2df87709f44b0dd733df86aef0830dce9b1f0f13", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": "^7.1 || ^8.0" - }, - "conflict": { - "scrutinizer/ocular": "1.7.*" + "league/config": "^1.1.1", + "php": "^7.4 || ^8.0", + "psr/event-dispatcher": "^1.0", + "symfony/polyfill-php80": "^1.15" }, "require-dev": { - "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.2", - "erusev/parsedown": "~1.0", + "cebe/markdown": "^1.0", + "commonmark/cmark": "0.30.0", + "commonmark/commonmark.js": "0.30.0", + "composer/package-versions-deprecated": "^1.8", + "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.90", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.2", - "scrutinizer/ocular": "^1.5", - "symfony/finder": "^4.2" + "michelf/php-markdown": "^1.4", + "phpstan/phpstan": "^0.12.88", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "symfony/finder": "^5.3", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "suggest": { + "symfony/yaml": "v2.3+ required if using the Front Matter extension" }, - "bin": [ - "bin/commonmark" - ], "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.1-dev" + } + }, "autoload": { "psr-4": { "League\\CommonMark\\": "src" @@ -2007,7 +2401,7 @@ "role": "Lead Developer" } ], - "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and Github-Flavored Markdown (GFM)", + "description": "Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)", "homepage": "https://commonmark.thephpleague.com", "keywords": [ "commonmark", @@ -2021,6 +2415,7 @@ ], "support": { "docs": "https://commonmark.thephpleague.com/", + "forum": "https://github.com/thephpleague/commonmark/discussions", "issues": "https://github.com/thephpleague/commonmark/issues", "rss": "https://github.com/thephpleague/commonmark/releases.atom", "source": "https://github.com/thephpleague/commonmark" @@ -2051,7 +2446,89 @@ "type": "tidelift" } ], - "time": "2021-07-17T17:13:23+00:00" + "time": "2021-08-14T14:06:04+00:00" + }, + { + "name": "league/config", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/config.git", + "reference": "a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/config/zipball/a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e", + "reference": "a9d39eeeb6cc49d10a6e6c36f22c4c1f4a767f3e", + "shasum": "" + }, + "require": { + "dflydev/dot-access-data": "^3.0.1", + "nette/schema": "^1.2", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.90", + "phpunit/phpunit": "^9.5.5", + "scrutinizer/ocular": "^1.8.1", + "unleashedtech/php-coding-standard": "^3.1", + "vimeo/psalm": "^4.7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Config\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "https://www.colinodell.com", + "role": "Lead Developer" + } + ], + "description": "Define configuration arrays with strict schemas and access values with dot notation", + "homepage": "https://config.thephpleague.com", + "keywords": [ + "array", + "config", + "configuration", + "dot", + "dot-access", + "nested", + "schema" + ], + "support": { + "docs": "https://config.thephpleague.com/", + "issues": "https://github.com/thephpleague/config/issues", + "rss": "https://github.com/thephpleague/config/releases.atom", + "source": "https://github.com/thephpleague/config" + }, + "funding": [ + { + "url": "https://www.colinodell.com/sponsor", + "type": "custom" + }, + { + "url": "https://www.paypal.me/colinpodell/10.00", + "type": "custom" + }, + { + "url": "https://github.com/colinodell", + "type": "github" + } + ], + "time": "2021-08-14T12:15:32+00:00" }, { "name": "league/event", @@ -2538,6 +3015,153 @@ ], "time": "2021-11-01T21:22:20+00:00" }, + { + "name": "nette/schema", + "version": "v1.2.2", + "source": { + "type": "git", + "url": "https://github.com/nette/schema.git", + "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/schema/zipball/9a39cef03a5b34c7de64f551538cbba05c2be5df", + "reference": "9a39cef03a5b34c7de64f551538cbba05c2be5df", + "shasum": "" + }, + "require": { + "nette/utils": "^2.5.7 || ^3.1.5 || ^4.0", + "php": ">=7.1 <8.2" + }, + "require-dev": { + "nette/tester": "^2.3 || ^2.4", + "phpstan/phpstan-nette": "^0.12", + "tracy/tracy": "^2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "📐 Nette Schema: validating data structures against a given Schema.", + "homepage": "https://nette.org", + "keywords": [ + "config", + "nette" + ], + "support": { + "issues": "https://github.com/nette/schema/issues", + "source": "https://github.com/nette/schema/tree/v1.2.2" + }, + "time": "2021-10-15T11:40:02+00:00" + }, + { + "name": "nette/utils", + "version": "v3.2.6", + "source": { + "type": "git", + "url": "https://github.com/nette/utils.git", + "reference": "2f261e55bd6a12057442045bf2c249806abc1d02" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nette/utils/zipball/2f261e55bd6a12057442045bf2c249806abc1d02", + "reference": "2f261e55bd6a12057442045bf2c249806abc1d02", + "shasum": "" + }, + "require": { + "php": ">=7.2 <8.2" + }, + "conflict": { + "nette/di": "<3.0.6" + }, + "require-dev": { + "nette/tester": "~2.0", + "phpstan/phpstan": "^1.0", + "tracy/tracy": "^2.3" + }, + "suggest": { + "ext-gd": "to use Image", + "ext-iconv": "to use Strings::webalize(), toAscii(), chr() and reverse()", + "ext-intl": "to use Strings::webalize(), toAscii(), normalize() and compare()", + "ext-json": "to use Nette\\Utils\\Json", + "ext-mbstring": "to use Strings::lower() etc...", + "ext-tokenizer": "to use Nette\\Utils\\Reflection::getUseStatements()", + "ext-xml": "to use Strings::length() etc. when mbstring is not available" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause", + "GPL-2.0-only", + "GPL-3.0-only" + ], + "authors": [ + { + "name": "David Grudl", + "homepage": "https://davidgrudl.com" + }, + { + "name": "Nette Community", + "homepage": "https://nette.org/contributors" + } + ], + "description": "🛠 Nette Utils: lightweight utilities for string & array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.", + "homepage": "https://nette.org", + "keywords": [ + "array", + "core", + "datetime", + "images", + "json", + "nette", + "paginator", + "password", + "slugify", + "string", + "unicode", + "utf-8", + "utility", + "validation" + ], + "support": { + "issues": "https://github.com/nette/utils/issues", + "source": "https://github.com/nette/utils/tree/v3.2.6" + }, + "time": "2021-11-24T15:47:23+00:00" + }, { "name": "nikic/php-parser", "version": "v4.13.2", @@ -2978,24 +3602,26 @@ }, { "name": "phpseclib/phpseclib", - "version": "2.0.35", + "version": "3.0.12", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "4e16cf3f5f927a7d3f5317820af795c0366c0420" + "reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4e16cf3f5f927a7d3f5317820af795c0366c0420", - "reference": "4e16cf3f5f927a7d3f5317820af795c0366c0420", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb", + "reference": "89bfb45bd8b1abc3b37e910d57f5dbd3174f40fb", "shasum": "" }, "require": { - "php": ">=5.3.3" + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" }, "require-dev": { "phing/phing": "~2.7", - "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", + "phpunit/phpunit": "^5.7|^6.0|^9.4", "squizlabs/php_codesniffer": "~2.0" }, "suggest": { @@ -3010,7 +3636,7 @@ "phpseclib/bootstrap.php" ], "psr-4": { - "phpseclib\\": "phpseclib/" + "phpseclib3\\": "phpseclib/" } }, "notification-url": "https://packagist.org/downloads/", @@ -3067,7 +3693,7 @@ ], "support": { "issues": "https://github.com/phpseclib/phpseclib/issues", - "source": "https://github.com/phpseclib/phpseclib/tree/2.0.35" + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.12" }, "funding": [ { @@ -3083,7 +3709,56 @@ "type": "tidelift" } ], - "time": "2021-11-28T23:30:39+00:00" + "time": "2021-11-28T23:46:03+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": "psr/container", @@ -3183,6 +3858,58 @@ }, "time": "2019-01-08T18:20:26+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, + "time": "2020-06-29T06:28:15+00:00" + }, { "name": "psr/http-factory", "version": "1.0.1", @@ -3467,6 +4194,50 @@ }, "time": "2021-11-30T14:05:36+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "ramsey/collection", "version": "1.2.2", @@ -6336,37 +7107,39 @@ }, { "name": "vlucas/phpdotenv", - "version": "v4.2.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "d38f4d1edcbe32515a0ad593cbd4c858e337263c" + "reference": "d4394d044ed69a8f244f3445bcedf8a0d7fe2403" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/d38f4d1edcbe32515a0ad593cbd4c858e337263c", - "reference": "d38f4d1edcbe32515a0ad593cbd4c858e337263c", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/d4394d044ed69a8f244f3445bcedf8a0d7fe2403", + "reference": "d4394d044ed69a8f244f3445bcedf8a0d7fe2403", "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.2", + "php": "^7.1.3 || ^8.0", + "phpoption/phpoption": "^1.8", + "symfony/polyfill-ctype": "^1.23", + "symfony/polyfill-mbstring": "^1.23.1", + "symfony/polyfill-php80": "^1.23.1" }, "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 || ^8.5.21" + "phpunit/phpunit": "^7.5.20 || ^8.5.21 || ^9.5.10" }, "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.2-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -6396,7 +7169,7 @@ ], "support": { "issues": "https://github.com/vlucas/phpdotenv/issues", - "source": "https://github.com/vlucas/phpdotenv/tree/v4.2.1" + "source": "https://github.com/vlucas/phpdotenv/tree/v5.4.0" }, "funding": [ { @@ -6408,7 +7181,7 @@ "type": "tidelift" } ], - "time": "2021-10-02T19:17:08+00:00" + "time": "2021-11-10T01:08:39+00:00" }, { "name": "voku/portable-ascii", @@ -6483,6 +7256,64 @@ } ], "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": [ @@ -6751,6 +7582,71 @@ }, "time": "2020-10-16T08:27:54+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.16.0", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/271d384d216e5e5c468a6b28feedf95d49f83b35", + "reference": "271d384d216e5e5c468a6b28feedf95d49f83b35", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/container": "^1.0 || ^2.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.16-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/v1.16.0" + }, + "time": "2021-09-06T14:53:37+00:00" + }, { "name": "filp/whoops", "version": "2.14.4", @@ -7005,35 +7901,34 @@ }, { "name": "nunomaduro/collision", - "version": "v4.3.0", + "version": "v5.10.0", "source": { "type": "git", "url": "https://github.com/nunomaduro/collision.git", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e" + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nunomaduro/collision/zipball/7c125dc2463f3e144ddc7e05e63077109508c94e", - "reference": "7c125dc2463f3e144ddc7e05e63077109508c94e", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/3004cfa49c022183395eabc6d0e5207dfe498d00", + "reference": "3004cfa49c022183395eabc6d0e5207dfe498d00", "shasum": "" }, "require": { "facade/ignition-contracts": "^1.0", - "filp/whoops": "^2.4", - "php": "^7.2.5 || ^8.0", + "filp/whoops": "^2.14.3", + "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", + "fruitcake/laravel-cors": "^2.0.3", + "laravel/framework": "8.x-dev", + "nunomaduro/larastan": "^0.6.2", + "nunomaduro/mock-final-classes": "^1.0", + "orchestra/testbench": "^6.0", + "phpstan/phpstan": "^0.12.64", + "phpunit/phpunit": "^9.5.0" }, "type": "library", "extra": { @@ -7089,7 +7984,7 @@ "type": "patreon" } ], - "time": "2020-10-29T15:12:23+00:00" + "time": "2021-09-20T15:06:32+00:00" }, { "name": "phar-io/manifest", @@ -8863,64 +9758,6 @@ } ], "time": "2021-07-28T10:34:58+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": [], @@ -8929,7 +9766,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^7.4" + "php": "^7.4|^8.0" }, "platform-dev": [], "plugin-api-version": "2.1.0" diff --git a/config/app.php b/config/app.php index eec9e14f..6460dc84 100644 --- a/config/app.php +++ b/config/app.php @@ -48,7 +48,7 @@ return [ | */ - 'debug' => env('APP_DEBUG', false), + 'debug' => (bool) env('APP_DEBUG', false), /* |-------------------------------------------------------------------------- @@ -210,12 +210,15 @@ return [ '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, + 'Js' => Illuminate\Support\Js::class, 'Lang' => Illuminate\Support\Facades\Lang::class, 'Log' => Illuminate\Support\Facades\Log::class, 'Mail' => Illuminate\Support\Facades\Mail::class, @@ -223,7 +226,7 @@ return [ 'Password' => Illuminate\Support\Facades\Password::class, 'Queue' => Illuminate\Support\Facades\Queue::class, 'Redirect' => Illuminate\Support\Facades\Redirect::class, - 'Redis' => Illuminate\Support\Facades\Redis::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, diff --git a/config/auth.php b/config/auth.php index 5656b0e9..1192b860 100644 --- a/config/auth.php +++ b/config/auth.php @@ -68,7 +68,7 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\Models\User::class, ], // 'users' => [ @@ -97,7 +97,21 @@ return [ 'provider' => 'users', 'table' => 'password_resets', 'expire' => 60, + 'throttle' => 60, ], ], + /* + |-------------------------------------------------------------------------- + | Password Confirmation Timeout + |-------------------------------------------------------------------------- + | + | Here you may define the amount of seconds before a password confirmation + | times out and the user is prompted to re-enter their password via the + | confirmation screen. By default, the timeout lasts for three hours. + | + */ + + 'password_timeout' => 10800, + ]; diff --git a/config/broadcasting.php b/config/broadcasting.php index 3ca45eaa..48e527e6 100644 --- a/config/broadcasting.php +++ b/config/broadcasting.php @@ -41,6 +41,11 @@ return [ ], ], + 'ably' => [ + 'driver' => 'ably', + 'key' => env('ABLY_KEY'), + ], + 'redis' => [ 'driver' => 'redis', 'connection' => 'default', diff --git a/config/cache.php b/config/cache.php index 30f0cae2..8736c7a7 100644 --- a/config/cache.php +++ b/config/cache.php @@ -13,9 +13,6 @@ return [ | 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 @@ return [ | 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", "octane", "null" + | */ 'stores' => [ @@ -39,12 +39,14 @@ return [ 'array' => [ 'driver' => 'array', + 'serialize' => false, ], 'database' => [ 'driver' => 'database', 'table' => 'cache', 'connection' => null, + 'lock_connection' => null, ], 'file' => [ @@ -74,6 +76,7 @@ return [ 'redis' => [ 'driver' => 'redis', 'connection' => 'cache', + 'lock_connection' => 'default', ], 'dynamodb' => [ @@ -82,6 +85,11 @@ return [ 'secret' => env('AWS_SECRET_ACCESS_KEY'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), + 'endpoint' => env('DYNAMODB_ENDPOINT'), + ], + + 'octane' => [ + 'driver' => 'octane', ], ], diff --git a/config/database.php b/config/database.php index cf738365..0863563a 100644 --- a/config/database.php +++ b/config/database.php @@ -134,17 +134,18 @@ return [ ], 'default' => [ + 'url' => env('REDIS_URL'), 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_DB', 0), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_DB', '0'), ], 'cache' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), - 'port' => env('REDIS_PORT', 6379), - 'database' => env('REDIS_CACHE_DB', 1), + 'port' => env('REDIS_PORT', '6379'), + 'database' => env('REDIS_CACHE_DB', '1'), ], ], diff --git a/config/filesystems.php b/config/filesystems.php index 77fa5ded..1f6d9964 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -26,7 +26,7 @@ return [ | */ - 'cloud' => env('FILESYSTEM_CLOUD', 's3'), + // 'cloud' => env('FILESYSTEM_CLOUD', 's3'), /* |-------------------------------------------------------------------------- @@ -62,8 +62,25 @@ return [ 'region' => env('AWS_DEFAULT_REGION'), 'bucket' => env('AWS_BUCKET'), 'url' => env('AWS_URL'), + 'endpoint' => env('AWS_ENDPOINT'), + 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), ], ], + /* + |-------------------------------------------------------------------------- + | Symbolic Links + |-------------------------------------------------------------------------- + | + | Here you may configure the symbolic links that will be created when the + | `storage:link` Artisan command is executed. The array keys should be + | the locations of the links and the values should be their targets. + | + */ + + 'links' => [ + public_path('storage') => storage_path('app/public'), + ], + ]; diff --git a/config/logging.php b/config/logging.php index fc254c3b..81cbd8a9 100644 --- a/config/logging.php +++ b/config/logging.php @@ -18,6 +18,19 @@ return [ 'default' => env('LOG_CHANNEL', 'stack'), + /* + |-------------------------------------------------------------------------- + | Deprecations Log Channel + |-------------------------------------------------------------------------- + | + | This option controls the log channel that should be used to log warnings + | regarding deprecated PHP and library features. This allows you to get + | your application ready for upcoming major versions of dependencies. + | + */ + + 'deprecations' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), + /* |-------------------------------------------------------------------------- | Log Channels @@ -43,13 +56,13 @@ return [ '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' => 7, ], @@ -58,12 +71,12 @@ return [ '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'), @@ -73,6 +86,7 @@ return [ 'stderr' => [ 'driver' => 'monolog', + 'level' => env('LOG_LEVEL', 'debug'), 'handler' => StreamHandler::class, 'formatter' => env('LOG_STDERR_FORMATTER'), 'with' => [ @@ -82,12 +96,21 @@ return [ 'syslog' => [ 'driver' => 'syslog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), ], 'errorlog' => [ 'driver' => 'errorlog', - 'level' => 'debug', + 'level' => env('LOG_LEVEL', 'debug'), + ], + + 'null' => [ + 'driver' => 'monolog', + 'handler' => NullHandler::class, + ], + + 'emergency' => [ + 'path' => storage_path('logs/laravel.log'), ], ], diff --git a/config/mail.php b/config/mail.php index 54299aab..e8607494 100644 --- a/config/mail.php +++ b/config/mail.php @@ -29,7 +29,7 @@ return [ | mailers below. You are free to add additional mailers as required. | | Supported: "smtp", "sendmail", "mailgun", "ses", - | "postmark", "log", "array" + | "postmark", "log", "array", "failover" | */ @@ -70,6 +70,14 @@ return [ 'array' => [ 'transport' => 'array', ], + + 'failover' => [ + 'transport' => 'failover', + 'mailers' => [ + 'smtp', + 'log', + ], + ], ], /* diff --git a/config/queue.php b/config/queue.php index 07c7d2a9..42a4ad48 100644 --- a/config/queue.php +++ b/config/queue.php @@ -39,6 +39,7 @@ return [ 'table' => 'jobs', 'queue' => 'default', 'retry_after' => 90, + 'after_commit' => false, ], 'beanstalkd' => [ @@ -47,6 +48,7 @@ return [ 'queue' => 'default', 'retry_after' => 90, 'block_for' => 0, + 'after_commit' => false, ], 'sqs' => [ @@ -55,7 +57,9 @@ return [ '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'), + 'suffix' => env('SQS_SUFFIX'), 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), + 'after_commit' => false, ], 'redis' => [ @@ -64,6 +68,7 @@ return [ 'queue' => env('REDIS_QUEUE', 'default'), 'retry_after' => 90, 'block_for' => null, + 'after_commit' => false, ], ], @@ -80,6 +85,7 @@ return [ */ 'failed' => [ + 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 'database' => env('DB_CONNECTION', 'mysql'), 'table' => 'failed_jobs', ], diff --git a/config/services.php b/config/services.php index f026b2c7..71cd052b 100644 --- a/config/services.php +++ b/config/services.php @@ -30,18 +30,18 @@ return [ 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), ], - 'sparkpost' => [ - 'secret' => env('SPARKPOST_SECRET'), - ], + // 'sparkpost' => [ + // 'secret' => env('SPARKPOST_SECRET'), + // ], - 'stripe' => [ - 'model' => App\User::class, - 'key' => env('STRIPE_KEY'), - 'secret' => env('STRIPE_SECRET'), - 'webhook' => [ - 'secret' => env('STRIPE_WEBHOOK_SECRET'), - 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), - ], - ], + // 'stripe' => [ + // 'model' => App\Models\User::class, + // 'key' => env('STRIPE_KEY'), + // 'secret' => env('STRIPE_SECRET'), + // 'webhook' => [ + // 'secret' => env('STRIPE_WEBHOOK_SECRET'), + // 'tolerance' => env('STRIPE_WEBHOOK_TOLERANCE', 300), + // ], + // ], ]; diff --git a/config/session.php b/config/session.php index f13ed2e2..a60d38cb 100644 --- a/config/session.php +++ b/config/session.php @@ -166,7 +166,7 @@ return [ | */ - 'secure' => env('SESSION_SECURE_COOKIE', null), + 'secure' => env('SESSION_SECURE_COOKIE'), /* |-------------------------------------------------------------------------- @@ -190,7 +190,7 @@ return [ | take place, and can be used to mitigate CSRF attacks. By default, we | do not enable this as other CSRF protection services are in place. | - | Supported: "lax", "strict" + | Supported: "lax", "strict", "none", null | */ diff --git a/database/.gitignore b/database/.gitignore index 97fc9767..9b19b93c 100644 --- a/database/.gitignore +++ b/database/.gitignore @@ -1,2 +1 @@ -*.sqlite -*.sqlite-journal +*.sqlite* diff --git a/database/factories/GroupFactory.php b/database/factories/GroupFactory.php index c030e27a..c3061ead 100644 --- a/database/factories/GroupFactory.php +++ b/database/factories/GroupFactory.php @@ -1,24 +1,21 @@ define(Group::class, function (Faker $faker) { - return [ - 'name' => $faker->word, - ]; -}); +class GroupFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + return [ + 'name' => $this->faker->word(), + ]; + } +} \ No newline at end of file diff --git a/database/factories/TwoFAccountFactory.php b/database/factories/TwoFAccountFactory.php index 7e93ca3c..86082f6c 100644 --- a/database/factories/TwoFAccountFactory.php +++ b/database/factories/TwoFAccountFactory.php @@ -1,38 +1,34 @@ define(TwoFAccount::class, function (Faker $faker) { - - $account = $faker->safeEmail; - $service = $faker->unique()->domainName; - $secret = Base32::encodeUpper($faker->regexify('[A-Z0-9]{8}')); - - return [ - 'otp_type' => 'totp', - 'account' => $account, - 'service' => $service, - 'secret' => $secret, - 'algorithm' => 'sha1', - 'digits' => 6, - 'period' => 30, - 'legacy_uri' => 'otpauth://hotp/' . $service . ':' . $account . '?secret=' . $secret . '&issuer=' . $service, - 'icon' => '', - ]; -}); \ No newline at end of file +class TwoFAccountFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition() + { + $account = $this->faker->safeEmail(); + $service = $this->faker->unique()->domainName(); + $secret = Base32::encodeUpper($this->faker->regexify('[A-Z0-9]{8}')); + + return [ + 'otp_type' => 'totp', + 'account' => $account, + 'service' => $service, + 'secret' => $secret, + 'algorithm' => 'sha1', + 'digits' => 6, + 'period' => 30, + 'legacy_uri' => 'otpauth://hotp/' . $service . ':' . $account . '?secret=' . $secret . '&issuer=' . $service, + 'icon' => '', + ]; + } +} \ No newline at end of file diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index cb9a44fd..88be7e1b 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -1,27 +1,39 @@ $this->faker->name(), + 'email' => $this->faker->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => bcrypt('password'), + 'remember_token' => Str::random(10), + ]; + } -$factory->define(User::class, function (Faker $faker) { - return [ - 'name' => $faker->name, - 'email' => $faker->unique()->safeEmail, - 'email_verified_at' => now(), - 'password' => bcrypt('password'), - 'remember_token' => Str::random(10), - ]; -}); + /** + * Indicate that the model's email address should be unverified. + * + * @return \Illuminate\Database\Eloquent\Factories\Factory + */ + public function unverified() + { + return $this->state(function (array $attributes) { + return [ + 'email_verified_at' => null, + ]; + }); + } +} \ No newline at end of file diff --git a/database/migrations/2020_03_25_095517_add_order_column_to_twofaccounts_table.php b/database/migrations/2020_03_25_095517_add_order_column_to_twofaccounts_table.php index 21c6488e..e70fb021 100644 --- a/database/migrations/2020_03_25_095517_add_order_column_to_twofaccounts_table.php +++ b/database/migrations/2020_03_25_095517_add_order_column_to_twofaccounts_table.php @@ -1,6 +1,6 @@ 'eCommerce', ]); - $groupSocialNetwork->twofaccounts()->create([ + $groupECommerce->twofaccounts()->create([ 'otp_type' => 'totp', 'account' => 'johndoe', 'service' => 'Amazon', diff --git a/database/seeds/TwoFAccountsTableSeeder.php b/database/seeders/TwoFAccountsTableSeeder.php similarity index 96% rename from database/seeds/TwoFAccountsTableSeeder.php rename to database/seeders/TwoFAccountsTableSeeder.php index 1c256a52..f42921fb 100644 --- a/database/seeds/TwoFAccountsTableSeeder.php +++ b/database/seeders/TwoFAccountsTableSeeder.php @@ -1,7 +1,10 @@ make(Illuminate\Contracts\Http\Kernel::class); +$kernel = $app->make(Kernel::class); $response = $kernel->handle( - $request = Illuminate\Http\Request::capture() -); + $request = Request::capture() +)->send(); -$response->send(); - -$kernel->terminate($request, $response); +$kernel->terminate($request, $response); \ No newline at end of file diff --git a/resources/lang/en/auth.php b/resources/lang/en/auth.php index 9513ca61..d7a95d46 100644 --- a/resources/lang/en/auth.php +++ b/resources/lang/en/auth.php @@ -15,6 +15,7 @@ return [ // Laravel 'failed' => 'These credentials do not match our records.', + 'password' => 'The provided password is incorrect.', 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', // 2FAuth diff --git a/resources/lang/en/validation.php b/resources/lang/en/validation.php index d9324ba8..a8205245 100644 --- a/resources/lang/en/validation.php +++ b/resources/lang/en/validation.php @@ -14,6 +14,7 @@ return [ */ 'accepted' => 'The :attribute must be accepted.', + 'accepted_if' => 'The :attribute must be accepted when :other is :value.', 'active_url' => 'The :attribute is not a valid URL.', 'after' => 'The :attribute must be a date after :date.', 'after_or_equal' => 'The :attribute must be a date after or equal to :date.', @@ -31,9 +32,12 @@ return [ ], 'boolean' => 'The :attribute field must be true or false.', 'confirmed' => 'The :attribute confirmation does not match.', + 'current_password' => 'The password is incorrect.', 'date' => 'The :attribute is not a valid date.', 'date_equals' => 'The :attribute must be a date equal to :date.', 'date_format' => 'The :attribute does not match the format :format.', + 'declined' => 'The :attribute must be declined.', + 'declined_if' => 'The :attribute must be declined when :other is :value.', 'different' => 'The :attribute and :other must be different.', 'digits' => 'The :attribute must be :digits digits.', 'digits_between' => 'The :attribute must be between :min and :max digits.', @@ -90,11 +94,16 @@ return [ 'string' => 'The :attribute must be at least :min characters.', 'array' => 'The :attribute must have at least :min items.', ], + 'multiple_of' => 'The :attribute must be a multiple of :value.', 'not_in' => 'The selected :attribute is invalid.', 'not_regex' => 'The :attribute format is invalid.', 'numeric' => 'The :attribute must be a number.', 'password' => 'The password is incorrect.', 'present' => 'The :attribute field must be present.', + 'prohibited' => 'The :attribute field is prohibited.', + 'prohibited_if' => 'The :attribute field is prohibited when :other is :value.', + 'prohibited_unless' => 'The :attribute field is prohibited unless :other is in :values.', + 'prohibits' => 'The :attribute field prohibits :other from being present.', 'regex' => 'The :attribute format is invalid.', 'required' => 'The :attribute field is required.', 'required_if' => 'The :attribute field is required when :other is :value.', diff --git a/routes/channels.php b/routes/channels.php index f16a20b9..1aa09248 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -11,6 +11,6 @@ | */ -Broadcast::channel('App.User.{id}', function ($user, $id) { +Broadcast::channel('App.Models.User.{id}', function ($user, $id) { return (int) $user->id === (int) $id; }); diff --git a/routes/console.php b/routes/console.php index 75dd0cde..0130cb39 100644 --- a/routes/console.php +++ b/routes/console.php @@ -15,4 +15,4 @@ use Illuminate\Foundation\Inspiring; Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); -})->describe('Display an inspiring quote'); +})->purpose('Display an inspiring quote'); diff --git a/storage/framework/.gitignore b/storage/framework/.gitignore index b02b700f..dff5a6c3 100644 --- a/storage/framework/.gitignore +++ b/storage/framework/.gitignore @@ -1,8 +1,9 @@ -config.php -routes.php -schedule-* compiled.php -services.json -events.scanned.php -routes.scanned.php +config.php down +events.scanned.php +maintenance.php +routes.php +routes.scanned.php +schedule-* +services.json \ No newline at end of file diff --git a/tests/Api/v1/Controllers/Auth/ForgotPasswordControllerTest.php b/tests/Api/v1/Controllers/Auth/ForgotPasswordControllerTest.php index c0605707..43914c62 100644 --- a/tests/Api/v1/Controllers/Auth/ForgotPasswordControllerTest.php +++ b/tests/Api/v1/Controllers/Auth/ForgotPasswordControllerTest.php @@ -1,8 +1,8 @@ user = factory(User::class)->create(); + $this->user = User::factory()->create(); $response = $this->json('POST', '/api/v1/user/password/lost', [ 'email' => $this->user->email diff --git a/tests/Api/v1/Controllers/Auth/PasswordControllerTest.php b/tests/Api/v1/Controllers/Auth/PasswordControllerTest.php index 9915109c..71a062cc 100644 --- a/tests/Api/v1/Controllers/Auth/PasswordControllerTest.php +++ b/tests/Api/v1/Controllers/Auth/PasswordControllerTest.php @@ -2,15 +2,15 @@ namespace Tests\Api\v1\Controllers\Auth; -use App\User; -use App\Group; +use App\Models\User; +use App\Models\Group; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; class PasswordControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -24,7 +24,7 @@ class PasswordControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } diff --git a/tests/Api/v1/Controllers/Auth/ResetPasswordControllerTest.php b/tests/Api/v1/Controllers/Auth/ResetPasswordControllerTest.php index c509b6ae..dd701642 100644 --- a/tests/Api/v1/Controllers/Auth/ResetPasswordControllerTest.php +++ b/tests/Api/v1/Controllers/Auth/ResetPasswordControllerTest.php @@ -1,8 +1,8 @@ user = factory(User::class)->create(); + $this->user = User::factory()->create(); $token = Password::broker()->createToken($this->user); $response = $this->json('POST', '/api/v1/user/password/reset', [ diff --git a/tests/Api/v1/Controllers/Auth/UserControllerTest.php b/tests/Api/v1/Controllers/Auth/UserControllerTest.php index 72bd95f5..598972da 100644 --- a/tests/Api/v1/Controllers/Auth/UserControllerTest.php +++ b/tests/Api/v1/Controllers/Auth/UserControllerTest.php @@ -2,13 +2,13 @@ namespace Tests\Api\v1\Controllers\Auth; -use App\User; +use App\Models\User; use Tests\FeatureTestCase; class UserControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -23,7 +23,7 @@ class UserControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } diff --git a/tests/Api/v1/Controllers/GroupControllerTest.php b/tests/Api/v1/Controllers/GroupControllerTest.php index ab20d52b..6eba47b6 100644 --- a/tests/Api/v1/Controllers/GroupControllerTest.php +++ b/tests/Api/v1/Controllers/GroupControllerTest.php @@ -2,10 +2,10 @@ namespace Tests\Api\v1\Controllers; -use App\User; -use App\Group; +use App\Models\User; +use App\Models\Group; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; /** @@ -15,7 +15,7 @@ use App\TwoFAccount; class GroupControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -27,7 +27,7 @@ class GroupControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } @@ -36,7 +36,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_index_returns_group_collection_with_pseudo_group() { - factory(Group::class, 3)->create(); + Group::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/groups') @@ -93,7 +93,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_show_returns_group_resource() { - $group = factory(Group::class)->create([ + $group = Group::factory()->create([ 'name' => 'My group', ]); @@ -127,7 +127,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_update_returns_updated_group_resource() { - $group = factory(Group::class)->create(); + $group = Group::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('PUT', '/api/v1/groups/' . $group->id, [ @@ -163,7 +163,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_update_with_invalid_data_returns_validation_error() { - $group = factory(Group::class)->create(); + $group = Group::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('PUT', '/api/v1/groups/' . $group->id, [ @@ -178,8 +178,8 @@ class GroupControllerTest extends FeatureTestCase */ public function test_assign_accounts_returns_updated_group_resource() { - $group = factory(Group::class)->create(); - $accounts = factory(TwoFAccount::class, 2)->create(); + $group = Group::factory()->create(); + $accounts = TwoFAccount::factory()->count(2)->create(); $response = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/groups/' . $group->id . '/assign', [ @@ -199,7 +199,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_assign_accounts_to_missing_group_returns_not_found() { - $accounts = factory(TwoFAccount::class, 2)->create(); + $accounts = TwoFAccount::factory()->count(2)->create(); $response = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/groups/1000/assign', [ @@ -217,8 +217,8 @@ class GroupControllerTest extends FeatureTestCase */ public function test_assign_invalid_accounts_returns_validation_error() { - $group = factory(Group::class)->create(); - $accounts = factory(TwoFAccount::class, 2)->create(); + $group = Group::factory()->create(); + $accounts = TwoFAccount::factory()->count(2)->create(); $response = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/groups/' . $group->id . '/assign', [ @@ -233,8 +233,8 @@ class GroupControllerTest extends FeatureTestCase */ public function test_get_assigned_accounts_returns_twofaccounts_collection() { - $group = factory(Group::class)->create(); - $accounts = factory(TwoFAccount::class, 2)->create(); + $group = Group::factory()->create(); + $accounts = TwoFAccount::factory()->count(2)->create(); $assign = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/groups/' . $group->id . '/assign', [ @@ -266,8 +266,8 @@ class GroupControllerTest extends FeatureTestCase */ public function test_get_assigned_accounts_returns_twofaccounts_collection_with_secret() { - $group = factory(Group::class)->create(); - $accounts = factory(TwoFAccount::class, 2)->create(); + $group = Group::factory()->create(); + $accounts = TwoFAccount::factory()->count(2)->create(); $assign = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/groups/' . $group->id . '/assign', [ @@ -316,7 +316,7 @@ class GroupControllerTest extends FeatureTestCase */ public function test_destroy_group_returns_success() { - $group = factory(Group::class)->create(); + $group = Group::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('DELETE', '/api/v1/groups/' . $group->id) diff --git a/tests/Api/v1/Controllers/IconControllerTest.php b/tests/Api/v1/Controllers/IconControllerTest.php index dd52a83d..eef1f391 100644 --- a/tests/Api/v1/Controllers/IconControllerTest.php +++ b/tests/Api/v1/Controllers/IconControllerTest.php @@ -6,7 +6,7 @@ use Illuminate\Http\UploadedFile; use Illuminate\Foundation\Testing\WithoutMiddleware; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; /** * @covers \App\Api\v1\Controllers\IconController diff --git a/tests/Api/v1/Controllers/QrCodeControllerTest.php b/tests/Api/v1/Controllers/QrCodeControllerTest.php index b56ab928..f2bbff1c 100644 --- a/tests/Api/v1/Controllers/QrCodeControllerTest.php +++ b/tests/Api/v1/Controllers/QrCodeControllerTest.php @@ -2,9 +2,9 @@ namespace Tests\Api\v1\Controllers; -use App\User; +use App\Models\User; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; use Tests\Classes\LocalFile; @@ -15,7 +15,7 @@ class QrCodeControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -27,7 +27,7 @@ class QrCodeControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } @@ -36,7 +36,7 @@ class QrCodeControllerTest extends FeatureTestCase */ public function test_show_qrcode_returns_base64_image() { - $twofaccount = factory(TwoFAccount::class)->create([ + $twofaccount = TwoFAccount::factory()->create([ 'otp_type' => 'totp', 'account' => 'account', 'service' => 'service', diff --git a/tests/Api/v1/Controllers/SettingControllerTest.php b/tests/Api/v1/Controllers/SettingControllerTest.php index 66072b65..b5aeab43 100644 --- a/tests/Api/v1/Controllers/SettingControllerTest.php +++ b/tests/Api/v1/Controllers/SettingControllerTest.php @@ -2,10 +2,10 @@ namespace Tests\Api\v1\Controllers; -use App\User; -use App\Group; +use App\Models\User; +use App\Models\Group; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; /** @@ -14,7 +14,7 @@ use App\TwoFAccount; class SettingControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -36,7 +36,7 @@ class SettingControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } diff --git a/tests/Api/v1/Controllers/TwoFAccountControllerTest.php b/tests/Api/v1/Controllers/TwoFAccountControllerTest.php index 88cc627d..9f68ef77 100644 --- a/tests/Api/v1/Controllers/TwoFAccountControllerTest.php +++ b/tests/Api/v1/Controllers/TwoFAccountControllerTest.php @@ -2,10 +2,10 @@ namespace Tests\Api\v1\Controllers; -use App\User; -use App\Group; +use App\Models\User; +use App\Models\Group; use Tests\FeatureTestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Storage; @@ -18,12 +18,12 @@ use Illuminate\Support\Facades\Storage; class TwoFAccountControllerTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; /** - * @var \App\Group + * @var \App\Models\Group */ protected $group; @@ -167,8 +167,8 @@ class TwoFAccountControllerTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); - $this->group = factory(Group::class)->create(); + $this->user = User::factory()->create(); + $this->group = Group::factory()->create(); } @@ -177,7 +177,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_index_returns_twofaccount_collection() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/twofaccounts') @@ -194,7 +194,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_index_returns_twofaccount_collection_with_secret() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/twofaccounts?withSecret=1') @@ -211,7 +211,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_show_twofaccount_returns_twofaccount_resource_with_secret() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/twofaccounts/' . $twofaccount->id) @@ -225,7 +225,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_show_twofaccount_returns_twofaccount_resource_without_secret() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/twofaccounts/' . $twofaccount->id . '?withSecret=0') @@ -242,7 +242,7 @@ class TwoFAccountControllerTest extends FeatureTestCase // $dbEncryptionService = resolve('App\Services\DbEncryptionService'); // $dbEncryptionService->setTo(true); - // $twofaccount = factory(TwoFAccount::class)->create(); + // $twofaccount = TwoFAccount::factory()->create(); // DB::table('twofaccounts') // ->where('id', $twofaccount->id) @@ -518,7 +518,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_update_totp_returns_success_with_updated_resource() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('PUT', '/api/v1/twofaccounts/' . $twofaccount->id, self::ARRAY_OF_FULL_VALID_PARAMETERS_FOR_CUSTOM_TOTP) @@ -532,7 +532,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_update_hotp_returns_success_with_updated_resource() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('PUT', '/api/v1/twofaccounts/' . $twofaccount->id, self::ARRAY_OF_FULL_VALID_PARAMETERS_FOR_CUSTOM_HOTP) @@ -557,7 +557,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_update_twofaccount_with_invalid_data_returns_validation_error() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('PUT', '/api/v1/twofaccounts/' . $twofaccount->id, self::ARRAY_OF_INVALID_PARAMETERS) @@ -570,7 +570,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_reorder_returns_success() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/twofaccounts/reorder', [ @@ -587,7 +587,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_reorder_with_invalid_data_returns_validation_error() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('POST', '/api/v1/twofaccounts/reorder', [ @@ -644,7 +644,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_get_otp_using_totp_twofaccount_id_returns_consistent_resource() { - $twofaccount = factory(TwoFAccount::class)->create([ + $twofaccount = TwoFAccount::factory()->create([ 'otp_type' => 'totp', 'account' => self::ACCOUNT, 'service' => self::SERVICE, @@ -706,7 +706,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_get_otp_using_hotp_twofaccount_id_returns_consistent_resource() { - $twofaccount = factory(TwoFAccount::class)->create([ + $twofaccount = TwoFAccount::factory()->create([ 'otp_type' => 'hotp', 'account' => self::ACCOUNT, 'service' => self::SERVICE, @@ -789,7 +789,7 @@ class TwoFAccountControllerTest extends FeatureTestCase $settingService = resolve('App\Services\SettingService'); $settingService->set('useEncryption', true); - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); DB::table('twofaccounts') ->where('id', $twofaccount->id) @@ -846,7 +846,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_count_returns_right_number_of_twofaccount() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $response = $this->actingAs($this->user, 'api') ->json('GET', '/api/v1/twofaccounts/count') @@ -862,7 +862,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_withdraw_returns_success() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $ids = DB::table('twofaccounts')->pluck('id')->implode(','); $response = $this->actingAs($this->user, 'api') @@ -879,7 +879,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_withdraw_too_many_ids_returns_bad_request() { - factory(TwoFAccount::class, 102)->create(); + TwoFAccount::factory()->count(102)->create(); $ids = DB::table('twofaccounts')->pluck('id')->implode(','); $response = $this->actingAs($this->user, 'api') @@ -897,7 +897,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_destroy_twofaccount_returns_success() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('DELETE', '/api/v1/twofaccounts/' . $twofaccount->id) @@ -910,7 +910,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_destroy_missing_twofaccount_returns_not_found() { - $twofaccount = factory(TwoFAccount::class)->create(); + $twofaccount = TwoFAccount::factory()->create(); $response = $this->actingAs($this->user, 'api') ->json('DELETE', '/api/v1/twofaccounts/1000') @@ -923,7 +923,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_batch_destroy_twofaccount_returns_success() { - factory(TwoFAccount::class, 3)->create(); + TwoFAccount::factory()->count(3)->create(); $ids = DB::table('twofaccounts')->pluck('id')->implode(','); $response = $this->actingAs($this->user, 'api') @@ -937,7 +937,7 @@ class TwoFAccountControllerTest extends FeatureTestCase */ public function test_batch_destroy_too_many_twofaccounts_returns_bad_request() { - factory(TwoFAccount::class, 102)->create(); + TwoFAccount::factory()->count(102)->create(); $ids = DB::table('twofaccounts')->pluck('id')->implode(','); $response = $this->actingAs($this->user, 'api') diff --git a/tests/Api/v1/Requests/GroupStoreRequestTest.php b/tests/Api/v1/Requests/GroupStoreRequestTest.php index 95fdc739..c015506d 100644 --- a/tests/Api/v1/Requests/GroupStoreRequestTest.php +++ b/tests/Api/v1/Requests/GroupStoreRequestTest.php @@ -2,7 +2,7 @@ namespace Tests\Api\v1\Requests; -use App\Group; +use App\Models\Group; use App\Api\v1\Requests\GroupStoreRequest; use Illuminate\Foundation\Testing\WithoutMiddleware; use Illuminate\Support\Facades\Validator; diff --git a/tests/Api/v1/Requests/UserStoreRequestTest.php b/tests/Api/v1/Requests/UserStoreRequestTest.php index f8a10a4c..7958d596 100644 --- a/tests/Api/v1/Requests/UserStoreRequestTest.php +++ b/tests/Api/v1/Requests/UserStoreRequestTest.php @@ -53,7 +53,7 @@ class UserStoreRequestTest extends FeatureTestCase */ public function test_invalid_data(array $data) : void { - $user = new \App\User( + $user = new \App\Models\User( [ 'name' => 'John', 'email' => 'john@example.com', diff --git a/tests/Feature/Auth/LoginTest.php b/tests/Feature/Auth/LoginTest.php index 6de641ae..6ca1bbd9 100644 --- a/tests/Feature/Auth/LoginTest.php +++ b/tests/Feature/Auth/LoginTest.php @@ -2,7 +2,7 @@ namespace Tests\Feature\Auth; -use App\User; +use App\Models\User; use Tests\FeatureTestCase; use Illuminate\Auth\Authenticatable; use Illuminate\Support\Facades\Auth; @@ -13,7 +13,7 @@ use Illuminate\Support\Facades\Config; class LoginTest extends FeatureTestCase { /** - * @var \App\User + * @var \App\Models\User */ protected $user; @@ -27,7 +27,7 @@ class LoginTest extends FeatureTestCase { parent::setUp(); - $this->user = factory(User::class)->create(); + $this->user = User::factory()->create(); } diff --git a/tests/Feature/Console/CheckDbConnectionTest.php b/tests/Feature/Console/CheckDbConnectionTest.php index cbf3e6c7..9475c3c9 100644 --- a/tests/Feature/Console/CheckDbConnectionTest.php +++ b/tests/Feature/Console/CheckDbConnectionTest.php @@ -2,7 +2,7 @@ namespace Tests\Feature\Console; -use App\User; +use App\Models\User; use Tests\FeatureTestCase; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; diff --git a/tests/Feature/Console/ResetDemoTest.php b/tests/Feature/Console/ResetDemoTest.php index ee1057e2..d1a36724 100644 --- a/tests/Feature/Console/ResetDemoTest.php +++ b/tests/Feature/Console/ResetDemoTest.php @@ -2,7 +2,7 @@ namespace Tests\Feature\Console; -use App\User; +use App\Models\User; use Tests\FeatureTestCase; use Illuminate\Support\Facades\Config; use Illuminate\Support\Facades\DB; diff --git a/tests/Feature/Http/Requests/LoginRequestTest.php b/tests/Feature/Http/Requests/LoginRequestTest.php index b31f7041..3e07dd74 100644 --- a/tests/Feature/Http/Requests/LoginRequestTest.php +++ b/tests/Feature/Http/Requests/LoginRequestTest.php @@ -1,7 +1,8 @@ create([ + User::factory()->create([ 'email' => 'JOHN.DOE@example.com' ]); @@ -67,7 +68,7 @@ class LoginRequestTest extends FeatureTestCase */ public function test_invalid_data(array $data) : void { - factory(\App\User::class)->create([ + User::factory()->create([ 'email' => 'JOHN.DOE@example.com' ]); diff --git a/tests/Feature/Services/GroupServiceTest.php b/tests/Feature/Services/GroupServiceTest.php index 12de60c4..e21976f8 100644 --- a/tests/Feature/Services/GroupServiceTest.php +++ b/tests/Feature/Services/GroupServiceTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature\Services; -use App\Group; -use App\TwoFAccount; +use App\Models\Group; +use App\Models\TwoFAccount; use Tests\FeatureTestCase; use Tests\Classes\LocalFile; use Illuminate\Support\Facades\DB; @@ -27,13 +27,13 @@ class GroupServiceTest extends FeatureTestCase /** - * App\Group $groupOne, $groupTwo + * App\Models\Group $groupOne, $groupTwo */ protected $groupOne, $groupTwo; /** - * App\Group $twofaccountOne, $twofaccountTwo + * App\Models\Group $twofaccountOne, $twofaccountTwo */ protected $twofaccountOne, $twofaccountTwo; @@ -137,7 +137,7 @@ class GroupServiceTest extends FeatureTestCase $newGroup = $this->groupService->create(['name' => self::NEW_GROUP_NAME]); $this->assertDatabaseHas('groups', ['name' => self::NEW_GROUP_NAME]); - $this->assertInstanceOf(\App\Group::class, $newGroup); + $this->assertInstanceOf(\App\Models\Group::class, $newGroup); $this->assertEquals(self::NEW_GROUP_NAME, $newGroup->name); } @@ -150,7 +150,7 @@ class GroupServiceTest extends FeatureTestCase $this->groupOne = $this->groupService->update($this->groupOne, ['name' => self::NEW_GROUP_NAME]); $this->assertDatabaseHas('groups', ['name' => self::NEW_GROUP_NAME]); - $this->assertInstanceOf(\App\Group::class, $this->groupOne); + $this->assertInstanceOf(\App\Models\Group::class, $this->groupOne); $this->assertEquals(self::NEW_GROUP_NAME, $this->groupOne->name); } diff --git a/tests/Feature/Services/SettingServiceTest.php b/tests/Feature/Services/SettingServiceTest.php index cf2d5d75..03c9bbe1 100644 --- a/tests/Feature/Services/SettingServiceTest.php +++ b/tests/Feature/Services/SettingServiceTest.php @@ -5,7 +5,7 @@ namespace Tests\Feature\Services; use Tests\FeatureTestCase; use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\DB; -use App\TwoFAccount; +use App\Models\TwoFAccount; /** @@ -20,7 +20,7 @@ class SettingServiceTest extends FeatureTestCase /** - * App\Group $groupOne, $groupTwo + * App\Models\Group $groupOne, $groupTwo */ protected $twofaccountOne, $twofaccountTwo; diff --git a/tests/Feature/Services/TwoFAccountServiceTest.php b/tests/Feature/Services/TwoFAccountServiceTest.php index 91f270e2..fb2c9a39 100644 --- a/tests/Feature/Services/TwoFAccountServiceTest.php +++ b/tests/Feature/Services/TwoFAccountServiceTest.php @@ -2,8 +2,8 @@ namespace Tests\Feature\Services; -use App\Group; -use App\TwoFAccount; +use App\Models\Group; +use App\Models\TwoFAccount; use Tests\FeatureTestCase; use Illuminate\Support\Facades\DB; @@ -20,19 +20,19 @@ class TwoFAccountServiceTest extends FeatureTestCase /** - * App\TwoFAccount $customTotpTwofaccount + * App\Models\TwoFAccount $customTotpTwofaccount */ protected $customTotpTwofaccount; /** - * App\Group $group + * App\Models\Group $group */ protected $group; /** - * App\TwoFAccount $customTotpTwofaccount + * App\Models\TwoFAccount $customTotpTwofaccount */ protected $customHotpTwofaccount; diff --git a/tests/Unit/Api/v1/Controllers/GroupControllerTest.php b/tests/Unit/Api/v1/Controllers/GroupControllerTest.php index ca76706f..dc466609 100644 --- a/tests/Unit/Api/v1/Controllers/GroupControllerTest.php +++ b/tests/Unit/Api/v1/Controllers/GroupControllerTest.php @@ -2,10 +2,10 @@ namespace Tests\Unit\Api\v1\Controllers; -use App\User; -use App\Group; +use App\Models\User; +use App\Models\Group; use Tests\TestCase; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Services\GroupService; use Illuminate\Foundation\Testing\WithoutMiddleware; use App\Api\v1\Controllers\GroupController; @@ -55,7 +55,7 @@ class GroupControllerTest extends TestCase */ public function test_index_returns_api_resources_using_groupService() { - $groups = factory(Group::class, 3)->make(); + $groups = Group::factory()->count(3)->make(); $this->groupServiceMock->shouldReceive('getAll') ->once() @@ -72,7 +72,7 @@ class GroupControllerTest extends TestCase */ public function test_store_returns_api_resource_stored_using_groupService() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $this->groupStoreRequest->shouldReceive('validated') ->once() @@ -84,7 +84,7 @@ class GroupControllerTest extends TestCase $response = $this->controller->store($this->groupStoreRequest); - $this->assertInstanceOf('App\Group', $response->original); + $this->assertInstanceOf('App\Models\Group', $response->original); } @@ -93,7 +93,7 @@ class GroupControllerTest extends TestCase */ public function test_show_returns_api_resource() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $response = $this->controller->show($group); @@ -106,7 +106,7 @@ class GroupControllerTest extends TestCase */ public function test_update_returns_api_resource_updated_using_groupService() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $this->groupStoreRequest->shouldReceive('validated') ->once() @@ -127,7 +127,7 @@ class GroupControllerTest extends TestCase */ public function test_assignAccounts_returns_api_resource_assigned_using_groupService() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $groupAssignRequest = Mockery::mock('App\Api\v1\Requests\GroupAssignRequest'); $groupAssignRequest->shouldReceive('validated') @@ -149,13 +149,13 @@ class GroupControllerTest extends TestCase */ public function test_accounts_returns_api_resources_fetched_using_groupService() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); \Facades\App\Services\SettingService::shouldReceive('get') ->with('useEncryption') ->andReturn(false); - $twofaccounts = factory(TwoFAccount::class, 3)->make(); + $twofaccounts = TwoFAccount::factory()->count(3)->make(); $this->groupServiceMock->shouldReceive('getAccounts') ->with($group) @@ -173,7 +173,7 @@ class GroupControllerTest extends TestCase */ public function test_destroy_uses_group_service() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $this->groupServiceMock->shouldReceive('delete') ->once() diff --git a/tests/Unit/Events/GroupDeletingTest.php b/tests/Unit/Events/GroupDeletingTest.php index 1953b84f..120528b4 100644 --- a/tests/Unit/Events/GroupDeletingTest.php +++ b/tests/Unit/Events/GroupDeletingTest.php @@ -2,7 +2,7 @@ namespace Tests\Unit\Events; -use App\Group; +use App\Models\Group; use App\Events\GroupDeleting; use Tests\TestCase; @@ -17,7 +17,7 @@ class GroupDeletingTest extends TestCase */ public function test_event_constructor() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $event = new GroupDeleting($group); $this->assertSame($group, $event->group); diff --git a/tests/Unit/Events/TwoFAccountDeletedTest.php b/tests/Unit/Events/TwoFAccountDeletedTest.php index 012bffb7..7783e8b1 100644 --- a/tests/Unit/Events/TwoFAccountDeletedTest.php +++ b/tests/Unit/Events/TwoFAccountDeletedTest.php @@ -2,7 +2,7 @@ namespace Tests\Unit\Events; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Events\TwoFAccountDeleted; use Tests\TestCase; @@ -21,7 +21,7 @@ class TwoFAccountDeletedTest extends TestCase ->with('useEncryption') ->andReturn(false); - $twofaccount = factory(TwoFAccount::class)->make(); + $twofaccount = TwoFAccount::factory()->make(); $event = new TwoFAccountDeleted($twofaccount); $this->assertSame($twofaccount, $event->twofaccount); diff --git a/tests/Unit/GroupModelTest.php b/tests/Unit/GroupModelTest.php index 941e7ed0..d3546650 100644 --- a/tests/Unit/GroupModelTest.php +++ b/tests/Unit/GroupModelTest.php @@ -2,14 +2,14 @@ namespace Tests\Unit; -use App\Group; -use App\TwoFAccount; +use App\Models\Group; +use App\Models\TwoFAccount; use App\Events\GroupDeleting; use Illuminate\Database\Eloquent\Relations\HasMany; use Tests\ModelTestCase; /** - * @covers \App\Group + * @covers \App\Models\Group */ class GroupModelTest extends ModelTestCase { diff --git a/tests/Unit/Listeners/CleanIconStorageTest.php b/tests/Unit/Listeners/CleanIconStorageTest.php index ce690b06..9f4a6277 100644 --- a/tests/Unit/Listeners/CleanIconStorageTest.php +++ b/tests/Unit/Listeners/CleanIconStorageTest.php @@ -2,7 +2,7 @@ namespace Tests\Unit\Listeners; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Events\TwoFAccountDeleted; use Tests\TestCase; use App\Listeners\CleanIconStorage; @@ -20,7 +20,7 @@ class CleanIconStorageTest extends TestCase ->with('useEncryption') ->andReturn(false); - $twofaccount = factory(TwoFAccount::class)->make(); + $twofaccount = TwoFAccount::factory()->make(); $event = new TwoFAccountDeleted($twofaccount); $listener = new CleanIconStorage(); diff --git a/tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php b/tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php index 03d3758c..d81bc837 100644 --- a/tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php +++ b/tests/Unit/Listeners/DissociateTwofaccountFromGroupTest.php @@ -2,8 +2,8 @@ namespace Tests\Unit\Listeners; -use App\Group; -use App\TwoFAccount; +use App\Models\Group; +use App\Models\TwoFAccount; use App\Events\GroupDeleting; use Tests\FeatureTestCase; use App\Listeners\DissociateTwofaccountFromGroup; @@ -17,7 +17,7 @@ class DissociateTwofaccountFromGroupTest extends FeatureTestCase { public function test_it_stores_time_to_session() { - $group = factory(Group::class)->make(); + $group = Group::factory()->make(); $event = new GroupDeleting($group); $listener = new DissociateTwofaccountFromGroup(); diff --git a/tests/Unit/TwoFAccountModelTest.php b/tests/Unit/TwoFAccountModelTest.php index e1ab4b56..873c05c9 100644 --- a/tests/Unit/TwoFAccountModelTest.php +++ b/tests/Unit/TwoFAccountModelTest.php @@ -2,7 +2,7 @@ namespace Tests\Unit; -use App\TwoFAccount; +use App\Models\TwoFAccount; use App\Events\TwoFAccountDeleted; use Tests\ModelTestCase; use Illuminate\Support\Facades\Event; @@ -10,7 +10,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Facades\Crypt; /** - * @covers \App\TwoFAccount + * @covers \App\Models\TwoFAccount */ class TwoFAccountModelTest extends ModelTestCase { @@ -48,7 +48,7 @@ class TwoFAccountModelTest extends ModelTestCase ->with('useEncryption') ->andReturn(true); - $twofaccount = factory(TwoFAccount::class)->make([ + $twofaccount = TwoFAccount::factory()->make([ $attribute => 'string', ]); @@ -84,7 +84,7 @@ class TwoFAccountModelTest extends ModelTestCase ->with('useEncryption') ->andReturn(false); - $twofaccount = factory(TwoFAccount::class)->make(); + $twofaccount = TwoFAccount::factory()->make(); $this->assertEquals($twofaccount->getAttributes()[$attribute], $twofaccount->$attribute); } @@ -104,7 +104,7 @@ class TwoFAccountModelTest extends ModelTestCase Crypt::shouldReceive('encryptString') ->andReturn('indecipherableString'); - $twofaccount = factory(TwoFAccount::class)->make(); + $twofaccount = TwoFAccount::factory()->make(); $this->assertEquals(__('errors.indecipherable'), $twofaccount->$attribute); } diff --git a/tests/Unit/UserModelTest.php b/tests/Unit/UserModelTest.php index a3efeb62..1d3c3809 100644 --- a/tests/Unit/UserModelTest.php +++ b/tests/Unit/UserModelTest.php @@ -2,11 +2,11 @@ namespace Tests\Unit; -use App\User; +use App\Models\User; use Tests\ModelTestCase; /** - * @covers \App\User + * @covers \App\Models\User */ class UserModelTest extends ModelTestCase { @@ -30,7 +30,7 @@ class UserModelTest extends ModelTestCase */ public function test_email_is_set_lowercased() { - $user = factory(User::class)->make([ + $user = User::factory()->make([ 'email' => 'UPPERCASE@example.COM', ]);