Upgrade to Laravel v7

This commit is contained in:
Jonny Barnes 2020-06-13 16:32:42 +01:00
parent dd4573cb45
commit 7fc3fb19c0
8 changed files with 1337 additions and 766 deletions

View file

@ -2,13 +2,13 @@
namespace App\Exceptions; namespace App\Exceptions;
use App;
use Exception; use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Http\Response; use Illuminate\Http\Response;
use Illuminate\Session\TokenMismatchException; use Illuminate\Session\TokenMismatchException;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Throwable;
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
@ -39,13 +39,13 @@ class Handler extends ExceptionHandler
* *
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param Exception $exception * @param Throwable $throwable
* @return void * @return void
* @throws Exception * @throws Exception
*/ */
public function report(Exception $exception) public function report(Throwable $throwable)
{ {
parent::report($exception); parent::report($throwable);
$guzzle = new \GuzzleHttp\Client([ $guzzle = new \GuzzleHttp\Client([
'headers' => [ 'headers' => [
@ -64,8 +64,8 @@ class Handler extends ExceptionHandler
'author_name' => app()->environment(), 'author_name' => app()->environment(),
'author_link' => config('app.url'), 'author_link' => config('app.url'),
'fields' => [[ 'fields' => [[
'title' => get_class($exception) ?? 'Unkown Exception', 'title' => get_class($this) ?? 'Unknown Exception',
'value' => $exception->getMessage() ?? '', 'value' => $throwable->getMessage() ?? '',
]], ]],
'ts' => time(), 'ts' => time(),
]], ]],
@ -78,16 +78,16 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param Request $request * @param Request $request
* @param Exception $exception * @param Throwable $throwable
* @return Response * @return Response
* @throws Exception * @throws Throwable
*/ */
public function render($request, Exception $exception) public function render($request, Throwable $throwable)
{ {
if ($exception instanceof TokenMismatchException) { if ($throwable instanceof TokenMismatchException) {
Route::getRoutes()->match($request); Route::getRoutes()->match($request);
} }
return parent::render($request, $exception); return parent::render($request, $throwable);
} }
} }

View file

@ -542,8 +542,8 @@ class Note extends Model
public function setContacts(): void public function setContacts(): void
{ {
$contacts = []; $contacts = [];
if ($this->getOriginal('note')) { if ($this->getRawOriginal('note')) {
preg_match_all(self::USERNAMES_REGEX, $this->getoriginal('note'), $matches); preg_match_all(self::USERNAMES_REGEX, $this->getRawOriginal('note'), $matches);
foreach ($matches[1] as $match) { foreach ($matches[1] as $match) {
$contacts[$match] = Contact::where('nick', mb_strtolower($match))->first(); $contacts[$match] = Contact::where('nick', mb_strtolower($match))->first();

View file

@ -9,8 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\{Builder, Model}; use Illuminate\Database\Eloquent\{Builder, Model};
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Phaza\LaravelPostgis\Eloquent\PostgisTrait; use MStaack\LaravelPostgis\Eloquent\PostgisTrait;
use Phaza\LaravelPostgis\Geometries\Point; use MStaack\LaravelPostgis\Geometries\Point;
// phpcs:disable Generic.Files.LineLength.TooLong // phpcs:disable Generic.Files.LineLength.TooLong

View file

@ -13,7 +13,7 @@
"ext-intl": "*", "ext-intl": "*",
"ext-json": "*", "ext-json": "*",
"ext-dom": "*", "ext-dom": "*",
"cviebrock/eloquent-sluggable": "~6.0", "cviebrock/eloquent-sluggable": "~7.0",
"fideloper/proxy": "~4.0", "fideloper/proxy": "~4.0",
"guzzlehttp/guzzle": "~6.0", "guzzlehttp/guzzle": "~6.0",
"indieauth/client": "~0.1", "indieauth/client": "~0.1",
@ -21,18 +21,18 @@
"jonnybarnes/indieweb": "dev-master", "jonnybarnes/indieweb": "dev-master",
"jonnybarnes/webmentions-parser": "0.4.*", "jonnybarnes/webmentions-parser": "0.4.*",
"jublonet/codebird-php": "4.0.0-beta.1", "jublonet/codebird-php": "4.0.0-beta.1",
"laravel/framework": "^6.0", "laravel/framework": "^7.0",
"laravel/horizon": "^3.0", "laravel/horizon": "^4.0",
"laravel/scout": "^7.0", "laravel/scout": "^8.0",
"laravel/telescope": "^2.0", "laravel/telescope": "^3.0",
"laravel/tinker": "^2.0", "laravel/tinker": "^2.0",
"lcobucci/jwt": "^3.1", "lcobucci/jwt": "^3.1",
"league/commonmark": "^1.0", "league/commonmark": "^1.0",
"league/commonmark-ext-autolink": "^1.0", "league/commonmark-ext-autolink": "^1.0",
"league/flysystem-aws-s3-v3": "^1.0", "league/flysystem-aws-s3-v3": "^1.0",
"mf2/mf2": "~0.3", "mf2/mf2": "~0.3",
"phaza/laravel-postgis": "~4.0", "mstaack/laravel-postgis": "~5.0",
"pmatseykanets/laravel-scout-postgres": "~6.0", "pmatseykanets/laravel-scout-postgres": "^7.0",
"predis/predis": "~1.0", "predis/predis": "~1.0",
"ramsey/uuid": "^3.5", "ramsey/uuid": "^3.5",
"sensiolabs/security-checker": "^6.0", "sensiolabs/security-checker": "^6.0",
@ -44,12 +44,12 @@
"barryvdh/laravel-debugbar": "^3.0", "barryvdh/laravel-debugbar": "^3.0",
"barryvdh/laravel-ide-helper": "^2.6", "barryvdh/laravel-ide-helper": "^2.6",
"beyondcode/laravel-dump-server": "^1.0", "beyondcode/laravel-dump-server": "^1.0",
"facade/ignition": "^1.4", "facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1", "fzaninotto/faker": "^1.9.1",
"laravel/dusk": "^5.0", "laravel/dusk": "^6.0",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0", "nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.0", "phpunit/phpunit": "^9.0",
"vimeo/psalm": "^3.9" "vimeo/psalm": "^3.9"
}, },
"config": { "config": {

2045
composer.lock generated

File diff suppressed because it is too large Load diff

View file

@ -166,7 +166,7 @@ return [
| |
*/ */
'secure' => env('SESSION_SECURE_COOKIE', false), 'secure' => env('SESSION_SECURE_COOKIE', null),
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View file

@ -1,6 +1,6 @@
<?php <?php
use Phaza\LaravelPostgis\Schema\Blueprint; use MStaack\LaravelPostgis\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class CreatePlacesTable extends Migration class CreatePlacesTable extends Migration

View file

@ -2,7 +2,7 @@
use App\Models\Place; use App\Models\Place;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Phaza\LaravelPostgis\Geometries\Point; use MStaack\LaravelPostgis\Geometries\Point;
class PlacesTableSeeder extends Seeder class PlacesTableSeeder extends Seeder
{ {