Skip to content
This repository has been archived by the owner on Jul 17, 2021. It is now read-only.

Commit

Permalink
Update to Laravel 7
Browse files Browse the repository at this point in the history
  • Loading branch information
egorsmkv committed Sep 1, 2020
1 parent fbd0245 commit c8b9bbf
Show file tree
Hide file tree
Showing 43 changed files with 4,342 additions and 1,717 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TELESCOPE_ENABLED=true
APP_URL=http://localhost:8000
OPCACHE_URL=http://localhost:8000

LOG_CHANNEL=stack
LOG_CHANNEL=daily

DB_CONNECTION=sqlite
DB_HOST=
Expand Down
2 changes: 1 addition & 1 deletion .env.prod.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TELESCOPE_ENABLED=false
APP_URL=http://localhost:8000
OPCACHE_URL=http://localhost:8000

LOG_CHANNEL=stack
LOG_CHANNEL=daily

DB_CONNECTION=sqlite
DB_HOST=
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
### Useful links

- Documentation: http://127.0.0.1:8000/docs/
- Log Viewer: http://127.0.0.1:8000/logs/
- Swagger: http://127.0.0.1:8000/api/v1/swagger/

### Development
Expand Down
23 changes: 16 additions & 7 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

namespace App\Exceptions;

use Exception;
use Illuminate\Support\Arr;
use Throwable;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
Expand Down Expand Up @@ -34,11 +35,11 @@ class Handler extends ExceptionHandler
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param Exception $exception
* @param Throwable $exception
*
* @return void
* @throws Exception
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
Expand All @@ -51,18 +52,26 @@ public function report(Exception $exception)
* Render an exception into an HTTP response.
*
* @param mixed $request
* @param Exception $e
* @param Throwable $e
*
* @return mixed
*
* @throws Throwable
*/
public function render($request, Exception $e)
public function render($request, Throwable $e)
{
$requestURI = $request->getRequestUri();

if ($e instanceof HttpException) {
$headers = $e->getHeaders();
$isBasicHttpAuth = Arr::has($headers, 'WWW-Authenticate');
$code = (string)$e->getStatusCode();
$message = (new Httpstatus())->getReasonPhrase($code);

if ($isBasicHttpAuth) {
return parent::render($request, $e);
}

$parameters = [
'data' => [
'code' => $code,
Expand All @@ -76,7 +85,7 @@ public function render($request, Exception $e)
}

return app()->call('App\Http\Controllers\ErrorsController@process', $parameters);
} else if ($e instanceof Exception) {
} else if ($e instanceof Throwable) {
$parameters = [
'data' => [
'code' => 500,
Expand Down
36 changes: 22 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "unknown",
"type": "project",
"require": {
"php": ">=7.1.3",
"php": ">=7.2",
"ext-json": "*",
"ext-curl": "*",
"ext-zip": "*",
Expand All @@ -16,40 +16,48 @@
"ext-filter": "*",
"ext-openssl": "*",
"ext-intl": "*",
"ext-pdo": "*",
"appstract/laravel-opcache": "3.2.1",
"beyondcode/laravel-self-diagnosis": "^1.4",
"doctrine/dbal": "^2.10",
"ellipsesynergie/api-response": "^0.16.0",
"fideloper/proxy": "~4.0",
"fideloper/proxy": "^4.2",
"fruitcake/laravel-cors": "^2.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"lucid-arch/laravel-foundation": "5.8.*",
"laravel/framework": "v7.27.0",
"laravel/tinker": "v2.4.2",
"lucid-arch/laravel-foundation": "v7.0.0",
"lukasoppermann/http-status": "^2.0",
"rap2hpoutre/laravel-log-viewer": "^1.6",
"arcanedev/log-viewer": "7.0.0",
"sentry/sentry-laravel": "^1.8",
"spatie/laravel-enum": "^1.6",
"spatie/laravel-fractal": "^5.7",
"sven/super-basic-auth": "^2.2",
"tymon/jwt-auth": "^1.0"
"tymon/jwt-auth": "^1.0",
"sven/super-basic-auth": "dev-laravel-7"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"beyondcode/laravel-dump-server": "1.4.0",
"emielmolenaar/phpcs-laravel": "^1.2",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"imanghafoori/laravel-microscope": "^1.0",
"laravel/telescope": "v2.1.7",
"lucid-arch/laravel-console": "5.8.*",
"laravel/telescope": "v3.5.1",
"lucid-arch/laravel-console": "v7.0.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"nunomaduro/larastan": "v0.4.3",
"nunomaduro/collision": "^4.1",
"nunomaduro/larastan": "v0.6.3",
"phpmd/phpmd": "^2.8",
"psalm/plugin-laravel": "^1.4",
"symfony/css-selector": "~4.0",
"symfony/dom-crawler": "~4.0",
"vimeo/psalm": "3.14.2"
"vimeo/psalm": "3.14.2",
"roave/security-advisories": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "git@github.com:svenluijten/super-basic-auth.git"
}
],
"autoload": {
"classmap": [
"database"
Expand Down
Loading

0 comments on commit c8b9bbf

Please sign in to comment.