From ff913e5304879163bcfc31f589035ad6784a5662 Mon Sep 17 00:00:00 2001 From: Nabeel S Date: Thu, 30 Jan 2020 09:00:41 -0500 Subject: [PATCH] Show admin dropdown for admin-access ability (#515) * Show admin dropdown for admin-access ability closes #509 * Formatting --- app/Database/seeds/dev/users.yml | 4 +- app/Database/seeds/permissions.yml | 2 +- app/Exceptions/Handler.php | 80 ++-- composer.lock | 390 +++++++++--------- .../Providers/UpdateServiceProvider.php | 2 +- resources/docker/php/Dockerfile | 2 +- .../layouts/default/dashboard/index.blade.php | 2 +- resources/views/layouts/default/nav.blade.php | 4 +- 8 files changed, 251 insertions(+), 235 deletions(-) diff --git a/app/Database/seeds/dev/users.yml b/app/Database/seeds/dev/users.yml index 695430c0..1500528b 100644 --- a/app/Database/seeds/dev/users.yml +++ b/app/Database/seeds/dev/users.yml @@ -22,8 +22,8 @@ users: - id: 2 pilot_id: 2 name: Test User - email: test@phpvms.net - password: test + email: user@phpvms.net + password: user api_key: testuserapikey airline_id: 1 rank_id: 1 diff --git a/app/Database/seeds/permissions.yml b/app/Database/seeds/permissions.yml index 222cc518..23a4531d 100644 --- a/app/Database/seeds/permissions.yml +++ b/app/Database/seeds/permissions.yml @@ -1,7 +1,7 @@ # All of the different permissions that can be assigned to roles --- - name: admin-access - display_name: Administrator + display_name: Admin Panel description: Access the admin panel - name: airlines display_name: Airlines diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index cfff05e4..ced89cc0 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -30,8 +30,8 @@ class Handler extends ExceptionHandler * A list of the exception types that should not be reported. */ protected $dontReport = [ - AuthenticationException::class, - AuthorizationException::class, + //AuthenticationException::class, + //AuthorizationException::class, AbstractHttpException::class, IlluminateValidationException::class, ModelNotFoundException::class, @@ -50,36 +50,7 @@ class Handler extends ExceptionHandler public function render($request, Exception $exception) { if ($request->is('api/*')) { - Log::error('API Error', $exception->getTrace()); - - if ($exception instanceof AbstractHttpException) { - return $exception->getResponse(); - } - - /* - * Not of the HttpException abstract class. Map these into - */ - - if ($exception instanceof ModelNotFoundException || - $exception instanceof NotFoundHttpException) { - $error = new AssetNotFound($exception); - return $error->getResponse(); - } - - // Custom exceptions should be extending HttpException - if ($exception instanceof SymfonyHttpException) { - $error = new SymfonyException($exception); - return $error->getResponse(); - } - - // Create the detailed errors from the validation errors - if ($exception instanceof IlluminateValidationException) { - $error = new ValidationException($exception); - return $error->getResponse(); - } - - $error = new GenericExceptionAbstract($exception); - return $error->getResponse(); + return $this->handleApiError($request, $exception); } if ($exception instanceof AbstractHttpException @@ -90,6 +61,51 @@ class Handler extends ExceptionHandler return parent::render($request, $exception); } + /** + * Handle errors in the API + * + * @param $request + * @param \Exception $exception + * + * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Response + */ + private function handleApiError($request, Exception $exception) + { + Log::error('API Error', $exception->getTrace()); + + if ($exception instanceof AbstractHttpException) { + return $exception->getResponse(); + } + + /* + * Not of the HttpException abstract class. Map these into + */ + + if ($exception instanceof ModelNotFoundException || $exception instanceof NotFoundHttpException) { + $error = new AssetNotFound($exception); + + return $error->getResponse(); + } + + // Custom exceptions should be extending HttpException + if ($exception instanceof SymfonyHttpException) { + $error = new SymfonyException($exception); + + return $error->getResponse(); + } + + // Create the detailed errors from the validation errors + if ($exception instanceof IlluminateValidationException) { + $error = new ValidationException($exception); + + return $error->getResponse(); + } + + $error = new GenericExceptionAbstract($exception); + + return $error->getResponse(); + } + /** * Convert an authentication exception into an unauthenticated response. * diff --git a/composer.lock b/composer.lock index 8afda5ec..93751f4d 100644 --- a/composer.lock +++ b/composer.lock @@ -558,16 +558,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.2.5", + "version": "1.2.6", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149" + "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/62e8fc2dc550e5d6d8c9360c7721662670f58149", - "reference": "62e8fc2dc550e5d6d8c9360c7721662670f58149", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/47fe531de31fca4a1b997f87308e7d7804348f7e", + "reference": "47fe531de31fca4a1b997f87308e7d7804348f7e", "shasum": "" }, "require": { @@ -610,7 +610,7 @@ "ssl", "tls" ], - "time": "2019-12-11T14:44:42+00:00" + "time": "2020-01-13T10:02:55+00:00" }, { "name": "composer/composer", @@ -694,24 +694,23 @@ }, { "name": "composer/semver", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e" + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/46d9139568ccb8d9e7cdd4539cab7347568a5e2e", - "reference": "46d9139568ccb8d9e7cdd4539cab7347568a5e2e", + "url": "https://api.github.com/repos/composer/semver/zipball/c6bea70230ef4dd483e6bbcab6005f682ed3a8de", + "reference": "c6bea70230ef4dd483e6bbcab6005f682ed3a8de", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { @@ -752,7 +751,7 @@ "validation", "versioning" ], - "time": "2019-03-19T17:25:45+00:00" + "time": "2020-01-13T12:06:48+00:00" }, { "name": "composer/spdx-licenses", @@ -1283,21 +1282,22 @@ }, { "name": "egulias/email-validator", - "version": "2.1.14", + "version": "2.1.15", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "c4b8d12921999d8a561004371701dbc2e05b5ece" + "reference": "e834eea5306d85d67de5a05db5882911d5b29357" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/c4b8d12921999d8a561004371701dbc2e05b5ece", - "reference": "c4b8d12921999d8a561004371701dbc2e05b5ece", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/e834eea5306d85d67de5a05db5882911d5b29357", + "reference": "e834eea5306d85d67de5a05db5882911d5b29357", "shasum": "" }, "require": { "doctrine/lexer": "^1.0.1", - "php": ">=5.5" + "php": ">=5.5", + "symfony/polyfill-intl-idn": "^1.10" }, "require-dev": { "dominicsayers/isemail": "^3.0.7", @@ -1336,7 +1336,7 @@ "validation", "validator" ], - "time": "2020-01-05T14:11:20+00:00" + "time": "2020-01-20T21:40:59+00:00" }, { "name": "elcobvg/laravel-opcache", @@ -1451,16 +1451,16 @@ }, { "name": "facade/ignition", - "version": "1.14.0", + "version": "1.16.0", "source": { "type": "git", "url": "https://github.com/facade/ignition.git", - "reference": "c6d36683b40e005cd395ddff1bbfbf0aa0fcd3c5" + "reference": "37f094775814b68d0c6cc8b8ff3c3be243f20725" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facade/ignition/zipball/c6d36683b40e005cd395ddff1bbfbf0aa0fcd3c5", - "reference": "c6d36683b40e005cd395ddff1bbfbf0aa0fcd3c5", + "url": "https://api.github.com/repos/facade/ignition/zipball/37f094775814b68d0c6cc8b8ff3c3be243f20725", + "reference": "37f094775814b68d0c6cc8b8ff3c3be243f20725", "shasum": "" }, "require": { @@ -1487,7 +1487,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "v2.x-dev" }, "laravel": { "providers": [ @@ -1518,7 +1518,7 @@ "laravel", "page" ], - "time": "2020-01-06T09:32:42+00:00" + "time": "2020-01-21T17:46:02+00:00" }, { "name": "facade/ignition-contracts", @@ -1566,16 +1566,16 @@ }, { "name": "filp/whoops", - "version": "2.7.0", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "4c97f814aa2f0dd4d5bedc89181c10ef12c004c5" + "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/4c97f814aa2f0dd4d5bedc89181c10ef12c004c5", - "reference": "4c97f814aa2f0dd4d5bedc89181c10ef12c004c5", + "url": "https://api.github.com/repos/filp/whoops/zipball/fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", + "reference": "fff6f1e4f36be0e0d0b84d66b413d9dcb0c49130", "shasum": "" }, "require": { @@ -1623,7 +1623,7 @@ "throwable", "whoops" ], - "time": "2019-12-29T10:00:00+00:00" + "time": "2020-01-15T10:00:00+00:00" }, { "name": "guzzlehttp/guzzle", @@ -2329,16 +2329,16 @@ }, { "name": "laravel/framework", - "version": "v6.10.1", + "version": "v6.13.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "fe45ad5bc89e5e1b08ab2c8687f9be01c9c84d14" + "reference": "f0059760814b76fb5f98bb80628607c7560ebe58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/fe45ad5bc89e5e1b08ab2c8687f9be01c9c84d14", - "reference": "fe45ad5bc89e5e1b08ab2c8687f9be01c9c84d14", + "url": "https://api.github.com/repos/laravel/framework/zipball/f0059760814b76fb5f98bb80628607c7560ebe58", + "reference": "f0059760814b76fb5f98bb80628607c7560ebe58", "shasum": "" }, "require": { @@ -2413,7 +2413,7 @@ "moontoast/math": "^1.1", "orchestra/testbench-core": "^4.0", "pda/pheanstalk": "^4.0", - "phpunit/phpunit": "^8.4|^9.0", + "phpunit/phpunit": "^7.5.15|^8.4|^9.0", "predis/predis": "^1.1.1", "symfony/cache": "^4.3.4" }, @@ -2472,7 +2472,7 @@ "framework", "laravel" ], - "time": "2020-01-08T21:17:42+00:00" + "time": "2020-01-28T21:44:01+00:00" }, { "name": "laravel/helpers", @@ -2597,16 +2597,16 @@ }, { "name": "league/commonmark", - "version": "1.1.2", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c" + "reference": "34cf4ddb3892c715ae785c880e6691d839cff88d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c", - "reference": "772e03fa9c6477ef5ef2d154fefd8a2a8d8ed03c", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/34cf4ddb3892c715ae785c880e6691d839cff88d", + "reference": "34cf4ddb3892c715ae785c880e6691d839cff88d", "shasum": "" }, "require": { @@ -2618,7 +2618,7 @@ }, "require-dev": { "cebe/markdown": "~1.0", - "commonmark/commonmark.js": "0.29.0", + "commonmark/commonmark.js": "0.29.1", "erusev/parsedown": "~1.0", "ext-json": "*", "michelf/php-markdown": "~1.4", @@ -2637,7 +2637,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -2664,7 +2664,7 @@ "markdown", "parser" ], - "time": "2019-12-10T02:55:03+00:00" + "time": "2020-01-16T01:18:13+00:00" }, { "name": "league/commonmark-ext-table", @@ -2958,16 +2958,16 @@ }, { "name": "league/iso3166", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/thephpleague/iso3166.git", - "reference": "f2dca0b179e3ea4486f8089d0f910716b2896033" + "reference": "aed3b32fc293afdf2c6c6a322c2408eb5d20804a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/iso3166/zipball/f2dca0b179e3ea4486f8089d0f910716b2896033", - "reference": "f2dca0b179e3ea4486f8089d0f910716b2896033", + "url": "https://api.github.com/repos/thephpleague/iso3166/zipball/aed3b32fc293afdf2c6c6a322c2408eb5d20804a", + "reference": "aed3b32fc293afdf2c6c6a322c2408eb5d20804a", "shasum": "" }, "require": { @@ -3008,7 +3008,7 @@ "iso", "library" ], - "time": "2019-10-23T06:57:59+00:00" + "time": "2020-01-29T07:08:12+00:00" }, { "name": "markrogoyski/math-php", @@ -3158,16 +3158,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.4", + "version": "1.9.5", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7" + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/579bb7356d91f9456ccd505f24ca8b667966a0a7", - "reference": "579bb7356d91f9456ccd505f24ca8b667966a0a7", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", + "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", "shasum": "" }, "require": { @@ -3202,7 +3202,7 @@ "object", "object graph" ], - "time": "2019-12-15T19:12:40+00:00" + "time": "2020-01-17T21:11:47+00:00" }, { "name": "nabeel/vacentral", @@ -3243,16 +3243,16 @@ }, { "name": "nesbot/carbon", - "version": "2.28.0", + "version": "2.29.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "e2bcbcd43e67ee6101d321d5de916251d2870ca8" + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e2bcbcd43e67ee6101d321d5de916251d2870ca8", - "reference": "e2bcbcd43e67ee6101d321d5de916251d2870ca8", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e509be5bf2d703390e69e14496d9a1168452b0a2", + "reference": "e509be5bf2d703390e69e14496d9a1168452b0a2", "shasum": "" }, "require": { @@ -3263,7 +3263,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", "kylekatarnls/multi-tester": "^1.1", - "phpmd/phpmd": "dev-php-7.1-compatibility", + "phpmd/phpmd": "^2.8", "phpstan/phpstan": "^0.11", "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" @@ -3309,7 +3309,7 @@ "datetime", "time" ], - "time": "2019-12-16T16:30:25+00:00" + "time": "2020-01-21T09:36:43+00:00" }, { "name": "nikic/php-parser", @@ -4462,16 +4462,16 @@ }, { "name": "scrivo/highlight.php", - "version": "v9.17.1.0", + "version": "v9.18.0.0", "source": { "type": "git", "url": "https://github.com/scrivo/highlight.php.git", - "reference": "5451a9ad6d638559cf2a092880f935c39776134e" + "reference": "0e7860058231b5bc843d1f5ac5c091be6b15b2d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/5451a9ad6d638559cf2a092880f935c39776134e", - "reference": "5451a9ad6d638559cf2a092880f935c39776134e", + "url": "https://api.github.com/repos/scrivo/highlight.php/zipball/0e7860058231b5bc843d1f5ac5c091be6b15b2d1", + "reference": "0e7860058231b5bc843d1f5ac5c091be6b15b2d1", "shasum": "" }, "require": { @@ -4481,8 +4481,8 @@ }, "require-dev": { "phpunit/phpunit": "^4.8|^5.7", - "symfony/finder": "^3.4", - "symfony/var-dumper": "^3.4" + "symfony/finder": "^2.8|^3.4", + "symfony/var-dumper": "^2.8|^3.4" }, "suggest": { "ext-dom": "Needed to make use of the features in the utilities namespace" @@ -4526,7 +4526,7 @@ "highlight.php", "syntax" ], - "time": "2019-12-13T21:54:06+00:00" + "time": "2020-01-29T15:18:09+00:00" }, { "name": "sebastiaanluca/laravel-helpers", @@ -4646,16 +4646,16 @@ }, { "name": "seld/phar-utils", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/Seldaek/phar-utils.git", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a" + "reference": "84715761c35808076b00908a20317a3a8a67d17e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/7009b5139491975ef6486545a39f3e6dad5ac30a", - "reference": "7009b5139491975ef6486545a39f3e6dad5ac30a", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/84715761c35808076b00908a20317a3a8a67d17e", + "reference": "84715761c35808076b00908a20317a3a8a67d17e", "shasum": "" }, "require": { @@ -4686,7 +4686,7 @@ "keywords": [ "phra" ], - "time": "2015-10-13T18:44:15+00:00" + "time": "2020-01-13T10:41:09+00:00" }, { "name": "semver/semver", @@ -4738,21 +4738,21 @@ }, { "name": "spatie/db-dumper", - "version": "2.15.0", + "version": "2.15.3", "source": { "type": "git", "url": "https://github.com/spatie/db-dumper.git", - "reference": "ccb7dd7557cd119b21ea853a893da4d1b0ff08b6" + "reference": "e167b8bf925c5da553f885326bb7bfaed3f95d15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/db-dumper/zipball/ccb7dd7557cd119b21ea853a893da4d1b0ff08b6", - "reference": "ccb7dd7557cd119b21ea853a893da4d1b0ff08b6", + "url": "https://api.github.com/repos/spatie/db-dumper/zipball/e167b8bf925c5da553f885326bb7bfaed3f95d15", + "reference": "e167b8bf925c5da553f885326bb7bfaed3f95d15", "shasum": "" }, "require": { "php": "^7.2", - "symfony/process": "^4.2" + "symfony/process": "^4.2|^5.0" }, "require-dev": { "phpunit/phpunit": "^7.0|^8.0" @@ -4784,20 +4784,20 @@ "mysqldump", "spatie" ], - "time": "2019-11-11T10:40:42+00:00" + "time": "2020-01-24T13:05:20+00:00" }, { "name": "spatie/laravel-backup", - "version": "6.7.6", + "version": "6.7.7", "source": { "type": "git", "url": "https://github.com/spatie/laravel-backup.git", - "reference": "9526cd53072644de6e4850cffaf79376c9a4f2d0" + "reference": "c2aeb1685007ee1cc2b3f86c26315aeb32602a93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/9526cd53072644de6e4850cffaf79376c9a4f2d0", - "reference": "9526cd53072644de6e4850cffaf79376c9a4f2d0", + "url": "https://api.github.com/repos/spatie/laravel-backup/zipball/c2aeb1685007ee1cc2b3f86c26315aeb32602a93", + "reference": "c2aeb1685007ee1cc2b3f86c26315aeb32602a93", "shasum": "" }, "require": { @@ -4859,7 +4859,7 @@ "laravel-backup", "spatie" ], - "time": "2019-12-12T13:39:26+00:00" + "time": "2020-01-27T13:58:27+00:00" }, { "name": "spatie/temporary-directory", @@ -5024,16 +5024,16 @@ }, { "name": "symfony/console", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0" + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/82437719dab1e6bdd28726af14cb345c2ec816d0", - "reference": "82437719dab1e6bdd28726af14cb345c2ec816d0", + "url": "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", + "reference": "e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f", "shasum": "" }, "require": { @@ -5096,20 +5096,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-12-17T10:32:23+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/css-selector", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837" + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/19d29e7098b7b2c3313cb03902ca30f100dcb837", - "reference": "19d29e7098b7b2c3313cb03902ca30f100dcb837", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ff60c90cb7950b592ebc84ad1289d0345bf24f9f", + "reference": "ff60c90cb7950b592ebc84ad1289d0345bf24f9f", "shasum": "" }, "require": { @@ -5149,20 +5149,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/debug", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5" + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/5c4c1db977dc70bb3250e1308d3e8c6341aa38f5", - "reference": "5c4c1db977dc70bb3250e1308d3e8c6341aa38f5", + "url": "https://api.github.com/repos/symfony/debug/zipball/89c3fd5c299b940333bc6fe9f1b8db1b0912c759", + "reference": "89c3fd5c299b940333bc6fe9f1b8db1b0912c759", "shasum": "" }, "require": { @@ -5205,20 +5205,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-12-16T14:46:54+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/error-handler", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1" + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/6d7d7712a6ff5215ec26215672293b154f1db8c1", - "reference": "6d7d7712a6ff5215ec26215672293b154f1db8c1", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/a59789092e40ad08465dc2cdc55651be503d0d5a", + "reference": "a59789092e40ad08465dc2cdc55651be503d0d5a", "shasum": "" }, "require": { @@ -5261,20 +5261,20 @@ ], "description": "Symfony ErrorHandler Component", "homepage": "https://symfony.com", - "time": "2019-12-16T14:46:54+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f" + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b3c3068a72623287550fe20b84a2b01dcba2686f", - "reference": "b3c3068a72623287550fe20b84a2b01dcba2686f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9e3de195e5bc301704dd6915df55892f6dfc208b", + "reference": "9e3de195e5bc301704dd6915df55892f6dfc208b", "shasum": "" }, "require": { @@ -5331,7 +5331,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-11-28T13:33:56+00:00" + "time": "2020-01-10T21:54:01+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -5393,16 +5393,16 @@ }, { "name": "symfony/filesystem", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591" + "reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/40c2606131d56eff6f193b6e2ceb92414653b591", - "reference": "40c2606131d56eff6f193b6e2ceb92414653b591", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/266c9540b475f26122b61ef8b23dd9198f5d1cfd", + "reference": "266c9540b475f26122b61ef8b23dd9198f5d1cfd", "shasum": "" }, "require": { @@ -5439,20 +5439,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2019-11-26T23:16:41+00:00" + "time": "2020-01-21T08:20:44+00:00" }, { "name": "symfony/finder", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e" + "reference": "3a50be43515590faf812fbd7708200aabc327ec3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ce8743441da64c41e2a667b8eb66070444ed911e", - "reference": "ce8743441da64c41e2a667b8eb66070444ed911e", + "url": "https://api.github.com/repos/symfony/finder/zipball/3a50be43515590faf812fbd7708200aabc327ec3", + "reference": "3a50be43515590faf812fbd7708200aabc327ec3", "shasum": "" }, "require": { @@ -5488,20 +5488,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-11-17T21:56:56+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62" + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/fcae1cff5b57b2a9c3aabefeb1527678705ddb62", - "reference": "fcae1cff5b57b2a9c3aabefeb1527678705ddb62", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/c33998709f3fe9b8e27e0277535b07fbf6fde37a", + "reference": "c33998709f3fe9b8e27e0277535b07fbf6fde37a", "shasum": "" }, "require": { @@ -5543,20 +5543,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-12-19T15:57:49+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2" + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/fe310d2e95cd4c356836c8ecb0895a46d97fede2", - "reference": "fe310d2e95cd4c356836c8ecb0895a46d97fede2", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/16f2aa3c54b08483fba5375938f60b1ff83b6bd2", + "reference": "16f2aa3c54b08483fba5375938f60b1ff83b6bd2", "shasum": "" }, "require": { @@ -5633,20 +5633,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-12-19T16:23:40+00:00" + "time": "2020-01-21T13:23:17+00:00" }, { "name": "symfony/inflector", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", - "reference": "aaeb5e293294070d1b061fa3d7889bac69909320" + "reference": "e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/aaeb5e293294070d1b061fa3d7889bac69909320", - "reference": "aaeb5e293294070d1b061fa3d7889bac69909320", + "url": "https://api.github.com/repos/symfony/inflector/zipball/e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2", + "reference": "e375603b6bd12e8e3aec3fc1b640ac18a4ef4cb2", "shasum": "" }, "require": { @@ -5691,20 +5691,20 @@ "symfony", "words" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/mime", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "0e6a4ced216e49d457eddcefb61132173a876d79" + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/0e6a4ced216e49d457eddcefb61132173a876d79", - "reference": "0e6a4ced216e49d457eddcefb61132173a876d79", + "url": "https://api.github.com/repos/symfony/mime/zipball/2a3c7fee1f1a0961fa9cf360d5da553d05095e59", + "reference": "2a3c7fee1f1a0961fa9cf360d5da553d05095e59", "shasum": "" }, "require": { @@ -5753,7 +5753,7 @@ "mime", "mime-type" ], - "time": "2019-11-30T14:12:50+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/polyfill-ctype", @@ -6108,16 +6108,16 @@ }, { "name": "symfony/process", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b" + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b84501ad50adb72a94fb460a5b5c91f693e99c9b", - "reference": "b84501ad50adb72a94fb460a5b5c91f693e99c9b", + "url": "https://api.github.com/repos/symfony/process/zipball/f5697ab4cb14a5deed7473819e63141bf5352c36", + "reference": "f5697ab4cb14a5deed7473819e63141bf5352c36", "shasum": "" }, "require": { @@ -6153,20 +6153,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-12-06T10:06:46+00:00" + "time": "2020-01-09T09:50:08+00:00" }, { "name": "symfony/property-access", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "055fe3134f8f301ff44af314d83463b858ea6413" + "reference": "090b4bc92ded1ec512f7e2ed1691210769dffdb3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/055fe3134f8f301ff44af314d83463b858ea6413", - "reference": "055fe3134f8f301ff44af314d83463b858ea6413", + "url": "https://api.github.com/repos/symfony/property-access/zipball/090b4bc92ded1ec512f7e2ed1691210769dffdb3", + "reference": "090b4bc92ded1ec512f7e2ed1691210769dffdb3", "shasum": "" }, "require": { @@ -6220,20 +6220,20 @@ "property path", "reflection" ], - "time": "2019-12-10T10:33:21+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/routing", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "628bcafae1b2043969378dcfbf9c196539a38722" + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/628bcafae1b2043969378dcfbf9c196539a38722", - "reference": "628bcafae1b2043969378dcfbf9c196539a38722", + "url": "https://api.github.com/repos/symfony/routing/zipball/7bf4e38573728e317b926ca4482ad30470d0e86a", + "reference": "7bf4e38573728e317b926ca4482ad30470d0e86a", "shasum": "" }, "require": { @@ -6296,20 +6296,20 @@ "uri", "url" ], - "time": "2019-12-12T12:53:52+00:00" + "time": "2020-01-08T17:29:02+00:00" }, { "name": "symfony/serializer", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "e5bc3f6dee44dc06e7e640cce4baa741b73ecb6e" + "reference": "76ecc214a93b763c29b924277e85f64326f9fbb2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/e5bc3f6dee44dc06e7e640cce4baa741b73ecb6e", - "reference": "e5bc3f6dee44dc06e7e640cce4baa741b73ecb6e", + "url": "https://api.github.com/repos/symfony/serializer/zipball/76ecc214a93b763c29b924277e85f64326f9fbb2", + "reference": "76ecc214a93b763c29b924277e85f64326f9fbb2", "shasum": "" }, "require": { @@ -6377,7 +6377,7 @@ ], "description": "Symfony Serializer Component", "homepage": "https://symfony.com", - "time": "2019-12-16T11:07:37+00:00" + "time": "2020-01-07T22:30:39+00:00" }, { "name": "symfony/service-contracts", @@ -6439,16 +6439,16 @@ }, { "name": "symfony/translation", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "f7669f48a9633bf8139bc026c755e894b7206677" + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/f7669f48a9633bf8139bc026c755e894b7206677", - "reference": "f7669f48a9633bf8139bc026c755e894b7206677", + "url": "https://api.github.com/repos/symfony/translation/zipball/f5d2ac46930238b30a9c2f1b17c905f3697d808c", + "reference": "f5d2ac46930238b30a9c2f1b17c905f3697d808c", "shasum": "" }, "require": { @@ -6511,7 +6511,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-12-12T12:53:52+00:00" + "time": "2020-01-15T13:29:06+00:00" }, { "name": "symfony/translation-contracts", @@ -6572,16 +6572,16 @@ }, { "name": "symfony/var-dumper", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99" + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/be330f919bdb395d1e0c3f2bfb8948512d6bdd99", - "reference": "be330f919bdb395d1e0c3f2bfb8948512d6bdd99", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", + "reference": "7cfa470bc3b1887a7b2a47c0a702a84ad614fa92", "shasum": "" }, "require": { @@ -6644,20 +6644,20 @@ "debug", "dump" ], - "time": "2019-12-18T13:41:29+00:00" + "time": "2020-01-04T13:00:46+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.2", + "version": "v4.4.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c" + "reference": "cd014e425b3668220adb865f53bff64b3ad21767" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/a08832b974dd5fafe3085a66d41fe4c84bb2628c", - "reference": "a08832b974dd5fafe3085a66d41fe4c84bb2628c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/cd014e425b3668220adb865f53bff64b3ad21767", + "reference": "cd014e425b3668220adb865f53bff64b3ad21767", "shasum": "" }, "require": { @@ -6703,7 +6703,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-12-10T10:33:21+00:00" + "time": "2020-01-21T11:12:16+00:00" }, { "name": "theiconic/php-ga-measurement-protocol", @@ -6956,16 +6956,16 @@ }, { "name": "willdurand/geocoder", - "version": "4.2.1", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/geocoder-php/php-common.git", - "reference": "aaa17bddb8dc9e4553110db8beb38534b095b61a" + "reference": "31bc59626c737871c3d5cc4dc9bc468a7668d0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/geocoder-php/php-common/zipball/aaa17bddb8dc9e4553110db8beb38534b095b61a", - "reference": "aaa17bddb8dc9e4553110db8beb38534b095b61a", + "url": "https://api.github.com/repos/geocoder-php/php-common/zipball/31bc59626c737871c3d5cc4dc9bc468a7668d0d1", + "reference": "31bc59626c737871c3d5cc4dc9bc468a7668d0d1", "shasum": "" }, "require": { @@ -6973,7 +6973,7 @@ }, "require-dev": { "nyholm/nsa": "^1.1", - "phpunit/phpunit": "6.3.*", + "phpunit/phpunit": "^6.5 || ^7.5", "symfony/stopwatch": "~2.5" }, "suggest": { @@ -6999,7 +6999,7 @@ ], "authors": [ { - "name": "William DURAND", + "name": "William Durand", "email": "william.durand1@gmail.com" } ], @@ -7011,7 +7011,7 @@ "geocoding", "geoip" ], - "time": "2018-12-26T12:01:09+00:00" + "time": "2020-01-22T09:02:24+00:00" } ], "packages-dev": [ @@ -8298,24 +8298,24 @@ }, { "name": "phpspec/prophecy", - "version": "1.10.1", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/cbe1df668b3fe136bcc909126a0f529a78d4cbbc", - "reference": "cbe1df668b3fe136bcc909126a0f529a78d4cbbc", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { "phpspec/phpspec": "^2.5 || ^3.2", @@ -8357,7 +8357,7 @@ "spy", "stub" ], - "time": "2019-12-22T21:05:45+00:00" + "time": "2020-01-20T15:57:02+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9362,16 +9362,16 @@ }, { "name": "symfony/options-resolver", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68" + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68", - "reference": "1ad3d0ffc00cc1990e5c9c7bb6b81578ec3f5f68", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b1ab86ce52b0c0abe031367a173005a025e30e04", + "reference": "b1ab86ce52b0c0abe031367a173005a025e30e04", "shasum": "" }, "require": { @@ -9412,7 +9412,7 @@ "configuration", "options" ], - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "symfony/polyfill-php70", @@ -9475,16 +9475,16 @@ }, { "name": "symfony/stopwatch", - "version": "v5.0.2", + "version": "v5.0.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "d410282956706e0b08681a5527447a8e6b6f421e" + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/d410282956706e0b08681a5527447a8e6b6f421e", - "reference": "d410282956706e0b08681a5527447a8e6b6f421e", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5d9add8034135b9a5f7b101d1e42c797e7f053e4", + "reference": "5d9add8034135b9a5f7b101d1e42c797e7f053e4", "shasum": "" }, "require": { @@ -9521,7 +9521,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2019-11-18T17:27:11+00:00" + "time": "2020-01-04T14:08:26+00:00" }, { "name": "theseer/tokenizer", diff --git a/modules/Updater/Providers/UpdateServiceProvider.php b/modules/Updater/Providers/UpdateServiceProvider.php index 01306cb0..2db32de4 100644 --- a/modules/Updater/Providers/UpdateServiceProvider.php +++ b/modules/Updater/Providers/UpdateServiceProvider.php @@ -23,7 +23,7 @@ class UpdateServiceProvider extends ServiceProvider Route::group([ 'as' => 'update.', 'prefix' => 'update', - 'middleware' => ['auth', 'ability:admin,admin-access', 'web'], + 'middleware' => ['web', 'auth', 'ability:admin,admin-access'], 'namespace' => 'Modules\Updater\Http\Controllers', ], function () { Route::get('/', 'UpdateController@index')->name('index'); diff --git a/resources/docker/php/Dockerfile b/resources/docker/php/Dockerfile index 11d32ec2..6745c308 100644 --- a/resources/docker/php/Dockerfile +++ b/resources/docker/php/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.3-fpm-alpine +FROM php:7.4-fpm-alpine RUN apk add make gmp-dev diff --git a/resources/views/layouts/default/dashboard/index.blade.php b/resources/views/layouts/default/dashboard/index.blade.php index fda20d2f..07e24d22 100644 --- a/resources/views/layouts/default/dashboard/index.blade.php +++ b/resources/views/layouts/default/dashboard/index.blade.php @@ -36,7 +36,7 @@
{{--110px font-size--}}
-

{{ $user->journal->balance }}

+

{{ optional($user->journal)->balance ?? 0 }}

@lang('dashboard.yourbalance')
diff --git a/resources/views/layouts/default/nav.blade.php b/resources/views/layouts/default/nav.blade.php index 35b9a429..fc7fb029 100644 --- a/resources/views/layouts/default/nav.blade.php +++ b/resources/views/layouts/default/nav.blade.php @@ -93,11 +93,11 @@   @lang('common.profile') - @role('admin') + @ability('admin', 'admin-access')   @lang('common.administration') - @endrole + @endability   @lang('common.logout')