Skip to content

Commit

Permalink
Merge pull request #7 from KodeStar/shift-110367
Browse files Browse the repository at this point in the history
Laravel 9.x Shift
  • Loading branch information
KodeStar authored Feb 16, 2024
2 parents ecb668a + 0189965 commit 095aff8
Show file tree
Hide file tree
Showing 155 changed files with 516 additions and 440 deletions.
6 changes: 3 additions & 3 deletions app/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public function class(): string
$name = $this->name;
$name = preg_replace('/[^\p{L}\p{N}]/u', '', $name);

return '\App\SupportedApps\\'.$name.'\\'.$name;
return \App\SupportedApps::class.$name.'\\'.$name;
}

/**
Expand All @@ -106,7 +106,7 @@ public static function classFromName($name): string
{
$name = preg_replace('/[^\p{L}\p{N}]/u', '', $name);

$class = '\App\SupportedApps\\'.$name.'\\'.$name;
$class = \App\SupportedApps::class.$name.'\\'.$name;

return $class;
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public static function single($appid)
return null;
}
$classname = preg_replace('/[^\p{L}\p{N}]/u', '', $app->name);
$app->class = '\App\SupportedApps\\'.$classname.'\\'.$classname;
$app->class = \App\SupportedApps::class.$classname.'\\'.$classname;

return $app;
}
Expand Down
9 changes: 0 additions & 9 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];

/**
* Define the application's command schedule.
*
Expand Down
15 changes: 12 additions & 3 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,28 @@

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.
*
* @var array
* @var array<int, class-string<\Throwable>>
*/
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 = [
'current_password',
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/ItemController.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ public static function storelogic(Request $request, $id = null): Item
'icon' => $path,
]);
} elseif (strpos($request->input('icon'), 'http') === 0) {
$options = array(
"ssl" => array(
$options = [
"ssl" => [
"verify_peer" => false,
"verify_peer_name" => false,
),
);
],
];

$file = $request->input('icon');
$path_parts = pathinfo($file);
Expand Down
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Middleware/TrimStrings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ class TrimStrings extends Middleware
/**
* The names of the attributes that should not be trimmed.
*
* @var array
* @var array<int, string>
*/
protected $except = [
'current_password',
'password',
'password_confirmation',
];
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Http\Middleware;

use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
use Illuminate\Http\Request;

class TrustProxies extends Middleware
Expand All @@ -19,5 +19,5 @@ class TrustProxies extends Middleware
*
* @var array
*/
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;
}
22 changes: 22 additions & 0 deletions app/Http/Middleware/ValidateSignature.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Http\Middleware;

use Illuminate\Routing\Middleware\ValidateSignature as Middleware;

class ValidateSignature extends Middleware
{
/**
* The names of the query string parameters that should be ignored.
*
* @var array<int, string>
*/
protected $except = [
// 'fbclid',
// 'utm_campaign',
// 'utm_content',
// 'utm_medium',
// 'utm_source',
// 'utm_term',
];
}
10 changes: 10 additions & 0 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ public function boot()

//
}

/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
{
return false;
}
}
3 changes: 0 additions & 3 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class RouteServiceProvider extends ServiceProvider
*
* REMOVED WITH LARAVEL 8 UPGRADE
*/
// protected $namespace = 'App\Http\Controllers';

/**
* Define your route model bindings, pattern filters, etc.
Expand Down Expand Up @@ -52,7 +51,6 @@ public function map()
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}

Expand All @@ -67,7 +65,6 @@ protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}
33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.4.32",
"facade/ignition": "^2.3.6",
"fideloper/proxy": "^4.0",
"php": "^8.0",
"graham-campbell/github": "^10.5",
"guzzlehttp/guzzle": "^7.4",
"laravel/framework": "^8.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^3.0",
"laravelcollective/html": "^6.0",
"nunomaduro/collision": "^5.0",
"symfony/yaml": "^5.4",
"laravel/framework": "^9.52",
"laravel/tinker": "^2.7",
"laravel/ui": "^3.3",
"laravelcollective/html": "^6.3",
"nunomaduro/collision": "^6.3",
"symfony/yaml": "^6.0",
"ext-json": "*",
"ext-intl": "*"
"ext-intl": "*",
"league/flysystem-aws-s3-v3": "^3.0",
"spatie/laravel-ignition": "^1.4"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.12",
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~9.0",
"filp/whoops": "^2.8",
"mockery/mockery": "^1.4.4",
"phpunit/phpunit": "^9.5.10",
"squizlabs/php_codesniffer": "3.*",
"symfony/thanks": "^1.0"
"symfony/thanks": "^1.2",
"fakerphp/faker": "^1.9.1"
},
"autoload": {
"classmap": [
Expand Down Expand Up @@ -71,7 +71,8 @@
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"@php artisan ide-helper:generate",
"@php artisan ide-helper:meta"
"@php artisan ide-helper:meta",
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
]
},
"config": {
Expand Down
66 changes: 24 additions & 42 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Illuminate\Support\Facades\Facade;

return [

/*
Expand Down Expand Up @@ -125,6 +127,24 @@

'cipher' => 'AES-256-CBC',

/*
|--------------------------------------------------------------------------
| Maintenance Mode Driver
|--------------------------------------------------------------------------
|
| These configuration options determine the driver used to determine and
| manage Laravel's "maintenance mode" status. The "cache" driver will
| allow maintenance mode to be controlled across multiple machines.
|
| Supported drivers: "file", "cache"
|
*/

'maintenance' => [
'driver' => 'file',
// 'store' => 'redis',
],

/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
Expand Down Expand Up @@ -190,51 +210,13 @@
|
*/

'aliases' => [

'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::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,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'aliases' => Facade::defaultAliases()->merge([
'EnhancedApps' => App\EnhancedApps::class,
'Form' => Collective\Html\FormFacade::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Html' => Collective\Html\HtmlFacade::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,
'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,
'Yaml' => Symfony\Component\Yaml\Yaml::class,

'SupportedApps' => App\SupportedApps::class,
'EnhancedApps' => App\EnhancedApps::class,

],
'Yaml' => Symfony\Component\Yaml\Yaml::class,
])->toArray(),

];
4 changes: 2 additions & 2 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
| Supported: "session"
|
*/

Expand Down Expand Up @@ -86,7 +86,7 @@
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| The expire time is the number of minutes that each reset token will be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
Expand Down
17 changes: 14 additions & 3 deletions config/broadcasting.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
| Supported: "pusher", "ably", "redis", "log", "null"
|
*/

Expand All @@ -36,9 +36,20 @@
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],

'ably' => [
'driver' => 'ably',
'key' => env('ABLY_KEY'),
],

'redis' => [
Expand Down
Loading

0 comments on commit 095aff8

Please sign in to comment.