Laravel 9 upgrade

This commit is contained in:
Čarodej
2022-02-25 17:37:17 +01:00
parent c3a6f5d703
commit ab3a307dc1
48 changed files with 1844 additions and 1549 deletions

View File

@@ -10,7 +10,7 @@ LOG_CHANNEL=daily
SCOUT_DRIVER=tntsearch
SCOUT_QUEUE=true
FILESYSTEM_DRIVER=local
FILESYSTEM_DISK=local
CHUNK_SIZE=128
DB_CONNECTION=mysql

View File

@@ -1,6 +1,6 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:yCFkwqoIPdc5TZIjrgoK40pCqj+rnCOlonN6nXc/sbk=
APP_KEY=base64:3eyU1lMJzg94d5p4slxUUe0gZmWwJHFJDVnozgZuPe4=
APP_DEBUG=true
APP_URL=http://localhost
APP_DEMO=false
@@ -14,7 +14,7 @@ DB_DATABASE=database/test.sqlite
DB_USERNAME=null
DB_PASSWORD=null
FILESYSTEM_DRIVER=local
FILESYSTEM_DISK=local
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file

View File

@@ -208,9 +208,9 @@ VueFileManager support these storages for your files:
In case of installation process, you will be able to set storage driver and credentials. After this, you can change your credentials later in `/.env` file.
To set or change your storage driver, you have to edit `FILESYSTEM_DRIVER` in your `/.env` file. Supported drivers are `s3`, `spaces`, `wasabi`,`backblaze` or `local`:
To set or change your storage driver, you have to edit `FILESYSTEM_DISK` in your `/.env` file. Supported drivers are `s3`, `spaces`, `wasabi`,`backblaze` or `local`:
```
FILESYSTEM_DRIVER=local
FILESYSTEM_DISK=local
```
Then you can find corresponding credentials options for your storage driver like key, secret, region in `/.env` file.

View File

@@ -8,52 +8,57 @@
],
"license": "MIT",
"require": {
"php": "^8.0",
"php": "^8.0.2",
"ext-json": "*",
"brianium/paratest": "^6.3.2",
"cocur/slugify": "^4.0",
"doctrine/dbal": "^2.13.4",
"fideloper/proxy": "^4.4.1",
"fruitcake/laravel-cors": "^2.0.4",
"ext-pdo": "*",
"brianium/paratest": "^6.4.1",
"cocur/slugify": "^4.1",
"doctrine/dbal": "^2.13.7",
"fruitcake/laravel-cors": "^2.0.5",
"gabrielelana/byte-units": "^0.5.0",
"guzzlehttp/guzzle": "^7.4.0",
"intervention/image": "^2.7.0",
"guzzlehttp/guzzle": "^7.4.1",
"intervention/image": "^2.7.1",
"jaybizzle/laravel-crawler-detect": "^1.2",
"kyslik/column-sortable": "^6.4.1",
"laravel/fortify": "^1.8.3",
"laravel/framework": "^8.77.1",
"laravel/sanctum": "^2.12.1",
"laravel/socialite": "^5.2",
"laravel/tinker": "^2.6.2",
"laravel/ui": "^3.3.1",
"league/flysystem-aws-s3-v3": "^1.0.29",
"league/flysystem-cached-adapter": "^1.1.0",
"laravel/fortify": "^1.10.0",
"laravel/framework": "^9.2",
"laravel/sanctum": "^2.14.2",
"laravel/socialite": "^5.4",
"laravel/tinker": "^2.7",
"laravel/ui": "^3.4.2",
"league/flysystem-aws-s3-v3": "^3.0.9",
"makingcg/laravel-scout-tntsearch-driver": "dev-master",
"makingcg/subscription": "dev-main",
"spatie/data-transfer-object": "^3.7.2",
"spatie/laravel-backup": "^6.16.5",
"spatie/laravel-query-builder": "^3.6",
"spatie/laravel-queueable-action": "^2.12",
"spatie/laravel-tail": "^4.3.3",
"spatie/data-transfer-object": "^3.7.3",
"spatie/laravel-backup": "^8.0.8",
"spatie/laravel-query-builder": "^5.0.0",
"spatie/laravel-queueable-action": "^2.13.1",
"spatie/laravel-tail": "^4.4.0",
"stechstudio/laravel-zipstream": "^4.5",
"teamtnt/laravel-scout-tntsearch-driver": "^11.5.0.0",
"vimeo/psalm": "^4.11.2",
"ext-pdo": "*"
"symfony/http-client": "^6.0",
"symfony/mailgun-mailer": "^6.0",
"symfony/postmark-mailer": "^6.0",
"vimeo/psalm": "^4.19.0"
},
"require-dev": {
"ext-json": "*",
"barryvdh/laravel-ide-helper": "^2.10",
"facade/ignition": "^2.16.0",
"fakerphp/faker": "^1.16.0",
"friendsofphp/php-cs-fixer": "^3.2.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10.0",
"barryvdh/laravel-ide-helper": "^2.12.1",
"friendsofphp/php-cs-fixer": "^3.5.0",
"spatie/laravel-ignition": "^1.0",
"nunomaduro/larastan": "^0.7.15",
"phpunit/phpunit": "^9.5.10"
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.16",
"mockery/mockery": "^1.5.0",
"fakerphp/faker": "^1.19.0",
"ext-json": "*"
},
"repositories": [
{
"type": "path",
"url": "../../PhpstormProjects/subscription"
},
{
"type": "vcs",
"url": "https://github.com/MakingCG/laravel-scout-tntsearch-driver.git"
}
],
"config": {

3114
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -111,7 +111,7 @@ return [
* The disk names on which the backups will be stored.
*/
'disks' => [
env('FILESYSTEM_DRIVER', 'local'),
env('FILESYSTEM_DISK', 'local'),
],
],

View File

@@ -12,20 +12,7 @@ return [
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
'default' => env('FILESYSTEM_DISK', 'local'),
/*
|--------------------------------------------------------------------------

View File

@@ -1,10 +0,0 @@
<?php
return [
// Confirm payment notification
'confirm_payment' => 'Confirm Payment',
'confirm_amount' => 'Confirm your :amount payment',
'confirm_description' => 'Extra confirmation is needed to process your payment. Please continue to the payment page by clicking on the button below.',
'confirm_button' => 'Confirm Payment',
];

View File

@@ -1,10 +0,0 @@
<?php
return [
// Confirm payment notification
'confirm_payment' => 'Confirm Payment',
'confirm_amount' => 'Confirm your :amount payment',
'confirm_description' => 'Extra confirmation is needed to process your payment. Please continue to the payment page by clicking on the button below.',
'confirm_button' => 'Confirm Payment',
];

View File

@@ -1,10 +0,0 @@
<?php
return [
// Confirm payment notification
'confirm_payment' => 'Potvrďte platbu',
'confirm_amount' => 'Potvrďte Vašu :amount platbu',
'confirm_description' => 'Extra potvrdenie je potrebne pre sprocesovanie platby. Prosím pokračujte pre potvrdenie platby tlačítkom nižšie.',
'confirm_button' => 'Potvrdiť platbu',
];

View File

@@ -53,7 +53,7 @@ class Kernel extends HttpKernel
'api' => [
EnsureFrontendRequestsAreStateful::class,
//'throttle:api',
'throttle:api',
SubstituteBindings::class,
],
];

View File

@@ -1,6 +1,9 @@
<?php
namespace App\Providers;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
@@ -27,97 +30,60 @@ class RouteServiceProvider extends ServiceProvider
*
* @return void
*/
public function map()
public function boot()
{
$this->mapApiRoutes();
$this->mapShareRoutes();
$this->mapUploadRequestRoutes();
$this->mapAdminApiRoutes();
$this->mapSetupWizardApiRoutes();
$this->mapUserApiRoutes();
$this->mapMaintenanceRoutes();
$this->mapFileRoutes();
$this->mapTeamsRoutes();
$this->mapWebRoutes();
}
$this->configureRateLimiting();
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->group(base_path('routes/web.php'));
}
protected function mapMaintenanceRoutes()
{
Route::middleware('web')
->group(base_path('routes/maintenance.php'));
}
protected function mapFileRoutes()
{
Route::middleware('web')
->group(base_path('routes/file.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
$this->routes(function () {
Route::prefix('api')
->middleware('api')
->group(base_path('routes/api.php'));
}
protected function mapShareRoutes()
{
Route::prefix('api')
->middleware('api')
->group(base_path('routes/share.php'));
}
protected function mapUploadRequestRoutes()
{
Route::prefix('api/upload-request')
->middleware('api')
->group(base_path('routes/upload-request.php'));
}
protected function mapAdminApiRoutes()
{
Route::prefix('api/admin')
->middleware(['api', 'auth:sanctum'])
->group(base_path('routes/admin.php'));
}
protected function mapUserApiRoutes()
{
Route::middleware(['setup-wizard'])
->group(base_path('routes/setup.php'));
Route::prefix('api/user')
->middleware('api')
->group(base_path('routes/user.php'));
}
protected function mapTeamsRoutes()
{
Route::middleware('web')
->group(base_path('routes/maintenance.php'));
Route::middleware('web')
->group(base_path('routes/file.php'));
Route::prefix('api/teams')
->middleware(['api'])
->group(base_path('routes/teams.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}
protected function mapSetupWizardApiRoutes()
/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
Route::middleware(['setup-wizard'])
->group(base_path('routes/setup.php'));
RateLimiter::for('api', function (Request $request) {
return $request->user()
? Limit::perMinute(1000)->by($request->user()->id)
: Limit::perMinute(100)->by($request->ip());
});
}
}

View File

@@ -17,10 +17,10 @@ class StoreEnvironmentSettingsController extends Controller
if (! app()->runningUnitTests()) {
$drivers = [
'local' => [
'FILESYSTEM_DRIVER' => 'local',
'FILESYSTEM_DISK' => 'local',
],
's3' => [
'FILESYSTEM_DRIVER' => 's3',
'FILESYSTEM_DISK' => 's3',
'S3_ACCESS_KEY_ID' => $request->input('storage.key') ?? null,
'S3_SECRET_ACCESS_KEY' => $request->input('storage.secret') ?? null,
'S3_DEFAULT_REGION' => $request->input('storage.region') ?? null,

View File

@@ -1,15 +1,15 @@
<?php
namespace Support\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<int, string>|string|null
*/
protected $proxies;
@@ -18,5 +18,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;
}

View File

@@ -245,7 +245,7 @@ if (! function_exists('get_storage')) {
*/
function get_storage()
{
return env('FILESYSTEM_DRIVER');
return env('FILESYSTEM_DISK');
}
}