Upgrade framework to laravel 9

This commit is contained in:
Deon George 2022-04-20 18:16:13 +10:00
parent 3fb6c0a052
commit 40d12b906b
8 changed files with 1557 additions and 1531 deletions

View File

@ -4,16 +4,7 @@ namespace App\Http\Controllers;
class WelcomeController extends Controller
{
public function __construct()
{
$this->middleware('demoMode');
}
public function home() {
return view('welcome.home');
}
public function under_construction() {
abort(499,'Under Construction');
}
}

View File

@ -58,7 +58,6 @@ class Kernel extends HttpKernel
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'demoMode' => \Spatie\DemoMode\DemoMode::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'role' => \App\Http\Middleware\Role::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,

View File

@ -3,7 +3,7 @@
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Middleware\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
@ -19,5 +19,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

@ -8,17 +8,15 @@ use Illuminate\Support\Collection;
use Illuminate\Database\Eloquent\Collection as DatabaseCollection;
use Illuminate\Support\Facades\DB;
use Laravel\Passport\HasApiTokens;
use Leenooks\Carbon;
use Leenooks\Traits\UserSwitch;
use Spinen\QuickBooks\HasQuickBooksToken;
use App\Notifications\ResetPassword as ResetPasswordNotification;
use App\Traits\SiteID;
class User extends Authenticatable
{
use HasApiTokens,Notifiable,UserSwitch,HasQuickBooksToken,SiteID;
use HasApiTokens,Notifiable,UserSwitch,SiteID;
protected $appends = [
'active_display',

View File

@ -5,37 +5,34 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.4|^8.0",
"php": "^8.0.2",
"ext-curl": "*",
"ext-pdo": "*",
"barryvdh/laravel-snappy": "^0.4.6",
"clarkeash/doorman": "^6.0",
"ext-zlib": "*",
"barryvdh/laravel-snappy": "^1.0",
"clarkeash/doorman": "^7.0",
"doctrine/dbal": "^2.10",
"eduardokum/laravel-mail-auto-embed": "^1.0",
"fideloper/proxy": "^4.4",
"eduardokum/laravel-mail-auto-embed": "^2.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"hmazter/laravel-schedule-list": "^2.1",
"intervention/image": "^2.5",
"laravel/framework": "^8.54",
"laravel/framework": "^9.0",
"laravel/passport": "^10.1",
"laravel/socialite": "^5.2",
"laravel/ui": "^3.2",
"leenooks/laravel": "^9.0",
"leenooks/laravel-theme": "^v2.0.17.2",
"leenooks/laravel-theme": "^v2.0.18",
"paypal/paypal-checkout-sdk": "^1.0",
"rennokki/laravel-eloquent-query-cache": "^2.6",
"repat/laravel-job-models": "^0.5.1",
"romanzipp/laravel-queue-monitor": "^2.0",
"spatie/laravel-demo-mode": "^2.5",
"spinen/laravel-quickbooks-client": "^4.0"
"rennokki/laravel-eloquent-query-cache": "^3.3",
"repat/laravel-job-models": "^0.7",
"romanzipp/laravel-queue-monitor": "^2.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.5",
"facade/ignition": "^2.5",
"barryvdh/laravel-debugbar": "^3.6",
"spatie/laravel-ignition": "^1.0",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.3.3"
},
"autoload": {

3032
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -146,5 +146,3 @@ Route::get('search',[SearchController::class,'search']);
Route::get('pay/paypal/authorise',[PaypalController::class,'authorise']);
Route::get('pay/paypal/cancel',[PaypalController::class,'cancel']);
Route::get('pay/paypal/capture',[PaypalController::class,'capture']);
// To access any routes protected by demo-mode.
Route::demoAccess('uc-access');

View File

@ -42,13 +42,11 @@ class InvoiceTest extends TestCase
$this->site_setup();
$this->account_setup();
dump($this->setup['site']);
// Create two services for the same account
// First service was billed a month ago, so this invoice will have 1 service charge
$po = Product::factory()->notStrict()->create([
'site_id'=>Arr::get($this->setup,'site.a')->site_id,
]);
dump($po);
$o = Service::factory()->create([
'site_id'=>Arr::get($this->setup,'site.a')->site_id,
'account_id'=>Arr::get($this->setup,'account.a')->id,