Update laravel to 9.x

This commit is contained in:
Deon George 2023-01-27 21:35:00 +11:00
parent e0185345c8
commit daeea9a1f6
16 changed files with 6785 additions and 7636 deletions

View File

@ -3,9 +3,9 @@ root = true
[*] [*]
charset = utf-8 charset = utf-8
end_of_line = lf end_of_line = lf
insert_final_newline = false
indent_style = tab
indent_size = 4 indent_size = 4
indent_style = tab
insert_final_newline = false
trim_trailing_whitespace = true trim_trailing_whitespace = true
[*.md] [*.md]

View File

@ -7,19 +7,28 @@ use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];
/** /**
* A list of the exception types that are not reported. * A list of the exception types that are not reported.
* *
* @var array * @var array<int, class-string<\Throwable>>
*/ */
protected $dontReport = [ protected $dontReport = [
// //
]; ];
/** /**
* A list of the inputs that are never flashed for validation exceptions. * A list of the inputs that are never flashed to the session on validation exceptions.
* *
* @var array * @var array<int, string>
*/ */
protected $dontFlash = [ protected $dontFlash = [
'current_password', 'current_password',

View File

@ -2,7 +2,7 @@
namespace App\Http\Middleware; namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware; use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request; use Illuminate\Http\Request;
class TrustProxies extends Middleware class TrustProxies extends Middleware
@ -10,7 +10,7 @@ class TrustProxies extends Middleware
/** /**
* The trusted proxies for this application. * The trusted proxies for this application.
* *
* @var array|string|null * @var array<int, string>|string|null
*/ */
protected $proxies; protected $proxies;
@ -19,5 +19,10 @@ class TrustProxies extends Middleware
* *
* @var int * @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;
} }

View File

@ -2,18 +2,18 @@
namespace App\Providers; namespace App\Providers;
// use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider class AuthServiceProvider extends ServiceProvider
{ {
/** /**
* The policy mappings for the application. * The model to policy mappings for the application.
* *
* @var array * @var array<class-string, class-string>
*/ */
protected $policies = [ protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy', // 'App\Models\Model' => 'App\Policies\ModelPolicy',
]; ];
/** /**

View File

@ -13,23 +13,14 @@ class RouteServiceProvider extends ServiceProvider
/** /**
* The path to the "home" route for your application. * The path to the "home" route for your application.
* *
* This is used by Laravel authentication to redirect users after login. * Typically, users are redirected here after authentication.
* *
* @var string * @var string
*/ */
public const HOME = '/'; public const HOME = '/';
/** /**
* The controller namespace for the application. * Define your route model bindings, pattern filters, and other route configuration.
*
* When present, controller route declarations will automatically be prefixed with this namespace.
*
* @var string|null
*/
// protected $namespace = 'App\\Http\\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
* *
* @return void * @return void
*/ */
@ -38,13 +29,11 @@ class RouteServiceProvider extends ServiceProvider
$this->configureRateLimiting(); $this->configureRateLimiting();
$this->routes(function () { $this->routes(function () {
Route::prefix('api') Route::middleware('api')
->middleware('api') ->prefix('api')
->namespace($this->namespace)
->group(base_path('routes/api.php')); ->group(base_path('routes/api.php'));
Route::middleware('web') Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php')); ->group(base_path('routes/web.php'));
}); });
} }
@ -57,7 +46,7 @@ class RouteServiceProvider extends ServiceProvider
protected function configureRateLimiting() protected function configureRateLimiting()
{ {
RateLimiter::for('api', function (Request $request) { RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
}); });
} }
} }

View File

@ -2,27 +2,25 @@
"name": "laravel/laravel", "name": "laravel/laravel",
"type": "project", "type": "project",
"description": "The Laravel Framework.", "description": "The Laravel Framework.",
"keywords": [ "framework", "laravel" ], "keywords": ["framework","laravel"],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": "^7.4|^8.0", "php": "^8.0.2",
"directorytree/ldaprecord-laravel": "^2", "directorytree/ldaprecord-laravel": "^2",
"fideloper/proxy": "^4.4", "fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0", "fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1", "guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^8.54", "laravel/framework": "^9.19",
"laravel/passport": "^10.1", "laravel/passport": "^10.1",
"laravel/ui": "^3.2", "laravel/ui": "^3.2",
"mcamara/laravel-localization": "^1.6", "mcamara/laravel-localization": "^1.7"
"orchestra/asset": "^6.1"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.5", "barryvdh/laravel-debugbar": "^3.5",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1", "fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2", "mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.0", "nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.3.3" "phpunit/phpunit": "^9.5.10"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@ -64,6 +62,6 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true "sort-packages": true
}, },
"minimum-stability": "dev", "minimum-stability": "stable",
"prefer-stable": true "prefer-stable": true
} }

3755
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
<?php <?php
use Illuminate\Support\Facades\Facade;
return [ return [
/* /*
@ -180,9 +182,6 @@ return [
/* /*
* Other Service Providers... * Other Service Providers...
*/ */
Orchestra\Asset\AssetServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
//\SocialiteProviders\Manager\ServiceProvider::class,
], ],
@ -197,48 +196,8 @@ return [
| |
*/ */
'aliases' => [ 'aliases' => Facade::defaultAliases()->merge([
// 'ExampleClass' => App\Example\ExampleClass::class,
'App' => Illuminate\Support\Facades\App::class, ])->toArray(),
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Asset' => Orchestra\Support\Facades\Asset::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'Date' => Illuminate\Support\Facades\Date::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Http' => Illuminate\Support\Facades\Http::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'RateLimiter' => Illuminate\Support\Facades\RateLimiter::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
// 'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
]; ];

View File

@ -19,6 +19,22 @@ return [
'default' => env('LOG_CHANNEL', 'stack'), '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' => [
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
'trace' => false,
],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| Log Channels | Log Channels
@ -65,10 +81,11 @@ return [
'papertrail' => [ 'papertrail' => [
'driver' => 'monolog', 'driver' => 'monolog',
'level' => env('LOG_LEVEL', 'debug'), 'level' => env('LOG_LEVEL', 'debug'),
'handler' => SyslogUdpHandler::class, 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
'handler_with' => [ 'handler_with' => [
'host' => env('PAPERTRAIL_URL'), 'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'), 'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
], ],
], ],

View File

@ -11,8 +11,16 @@
}, },
"devDependencies": { "devDependencies": {
"axios": "^0.21", "axios": "^0.21",
"jquery": "^3.6.3",
"laravel-mix": "^6.0.6", "laravel-mix": "^6.0.6",
"lodash": "^4.17.19", "lodash": "^4.17.19",
"postcss": "^8.1.14" "mix": "^0.0.1",
"postcss": "^8.1.14",
"resolve-url-loader": "^5.0.0",
"sass": "^1.57.1",
"sass-loader": "^12.1.0",
"yarn": "^1.22.19"
},
"dependencies": {
} }
} }

View File

@ -16,8 +16,8 @@ define('LARAVEL_START', microtime(true));
| |
*/ */
if (file_exists(__DIR__.'/../storage/framework/maintenance.php')) { if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require __DIR__.'/../storage/framework/maintenance.php'; require $maintenance;
} }
/* /*
@ -48,8 +48,8 @@ $app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Kernel::class); $kernel = $app->make(Kernel::class);
$response = tap($kernel->handle( $response = $kernel->handle(
$request = Request::capture() $request = Request::capture()
))->send(); )->send();
$kernel->terminate($request, $response); $kernel->terminate($request, $response);

2
resources/js/app.js vendored
View File

@ -1 +1 @@
require('./bootstrap'); import './bootstrap';

View File

@ -38,9 +38,6 @@
@section('scripts') @section('scripts')
@include('architect::layouts.partials.scripts') @include('architect::layouts.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts') @yield('page-scripts')
@show @show
</body> </body>

View File

@ -12,9 +12,6 @@
@section('scripts') @section('scripts')
@include('architect::auth.partials.scripts') @include('architect::auth.partials.scripts')
{{-- Scripts --}}
{!! Asset::scripts() !!}
@yield('page-scripts') @yield('page-scripts')
@show @show
</body> </body>

View File

@ -38,9 +38,6 @@
<link rel="stylesheet" href="{{ url('/css/flags16-both.css') }}"> <link rel="stylesheet" href="{{ url('/css/flags16-both.css') }}">
<link rel="stylesheet" href="{{ url('/css/flags32-both.css') }}"> <link rel="stylesheet" href="{{ url('/css/flags32-both.css') }}">
<!-- STYLESHEETS -->
{!! Asset::styles() !!}
<!-- Theme style --> <!-- Theme style -->
<link rel="stylesheet" href="{{ asset('/css/architect.min.css') }}"> <link rel="stylesheet" href="{{ asset('/css/architect.min.css') }}">

10488
yarn.lock

File diff suppressed because it is too large Load Diff