Skip to content

Commit

Permalink
Upgrade to Laravel 9
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp77 committed Oct 11, 2022
1 parent 4f2e049 commit 85917f1
Show file tree
Hide file tree
Showing 27 changed files with 100 additions and 12,112 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check & Fix Styling

on:
pull_request:
branches:
- master
paths:
- '**.php'

jobs:
php-cs-fixer:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
token: ${{ secrets.REPO }}

- name: Laravel Pint
uses: aglipanci/[email protected]
with:
preset: laravel

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: PHP Linting (Pint)
2 changes: 1 addition & 1 deletion app/Http/Controllers/Core/MainController.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ public function serverMonitorRefresh(): array
{
return $this->serverMonitor->runCheck(request()->check);
}
}
}
6 changes: 3 additions & 3 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Kernel extends HttpKernel
protected $middleware = [
// \App\Http\Middleware\TrustHosts::class,
\App\Http\Middleware\TrustProxies::class,
\Fruitcake\Cors\HandleCors::class,
\Illuminate\Http\Middleware\HandleCors::class,
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
Expand All @@ -25,7 +25,7 @@ class Kernel extends HttpKernel
\RenatoMarinho\LaravelPageSpeed\Middleware\ElideAttributes::class,
\RenatoMarinho\LaravelPageSpeed\Middleware\InsertDNSPrefetch::class,
// \RenatoMarinho\LaravelPageSpeed\Middleware\RemoveComments::class,
//\RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,
//\RenatoMarinho\LaravelPageSpeed\Middleware\TrimUrls::class,
//\RenatoMarinho\LaravelPageSpeed\Middleware\RemoveQuotes::class,
\RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace::class, // Note: This middleware invokes "RemoveComments::class" before it runs.
// \RenatoMarinho\LaravelPageSpeed\Middleware\DeferJavascript::class,
Expand Down Expand Up @@ -71,4 +71,4 @@ class Kernel extends HttpKernel
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
}
}
11 changes: 8 additions & 3 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

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
{
/**
* The trusted proxies for this application.
*
* @var array|string|null
* @var array<int, string>|string|null
*/
protected $proxies;

Expand All @@ -19,5 +19,10 @@ class TrustProxies extends Middleware
*
* @var int
*/
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;
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',
];
}
18 changes: 9 additions & 9 deletions app/Http/Traits/CoreTrait.php → app/Traits/CoreTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Traits;
namespace App\Traits;

use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
Expand All @@ -10,7 +10,7 @@ trait CoreTrait
{
/**
* Create random code.
*
*
* @param string $prefix
* @param string $table
* @return string
Expand All @@ -29,7 +29,7 @@ public function createCode($prefix, $table)

/**
* Check record exist.
*
*
* @param string $table
* @param string $name
* @param string $column
Expand All @@ -44,8 +44,8 @@ public function checkDuplicate($table, $name, $column)

/**
* Get ID for PostgreSQL.
*
* @param string $table
*
* @param string $table
* @return int
*/
public function getID($table)
Expand All @@ -59,7 +59,7 @@ public function getID($table)

/**
* Get total ram.
*
*
* @return array|object
*/
public function getTotalRAM()
Expand Down Expand Up @@ -112,7 +112,7 @@ public function getTotalRAM()

/**
* Get total CPU.
*
*
* @return array|object
*/
public function getTotalCPU()
Expand All @@ -137,7 +137,7 @@ public function getTotalCPU()

/**
* Get total disk.
*
*
* @return array|object
*/
public function getTotalDisk()
Expand All @@ -159,4 +159,4 @@ public function getTotalDisk()
"disk_used_size" => round($disk_used_size) . __(' GB')
);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace App\Http\Traits;
namespace App\Traits;

use Illuminate\Support\Str;

trait MainTrait
trait CurrencyTrait
{
/**
* Add prefix for ID currency.
Expand Down Expand Up @@ -72,4 +72,4 @@ function denominator($value)

return Str::upper($toText);
}
}
}
8 changes: 4 additions & 4 deletions app/Http/Traits/DateTrait.php → app/Traits/DateTrait.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace App\Http\Traits;
namespace App\Traits;

trait DateTrait
{
/**
* Change month ID to EN.
*
* @param string $dates
* @param string $dates
* @return string
*/
public function changeMonthIdToEn($dates)
Expand Down Expand Up @@ -52,7 +52,7 @@ public function changeMonthIdToEn($dates)
/**
* Change date ID to EN.
*
* @param string $dates
* @param string $dates
* @return string
*/
public function getDate($date)
Expand All @@ -67,4 +67,4 @@ public function getDate($date)

return $year . '-' . $month . '-' . $day;
}
}
}
34 changes: 13 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,28 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"appslabke/lara-izitoast": "^1.1",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"imliam/laravel-env-set-command": "1.0",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"laravolt/indonesia": "^0.30.0",
"milon/barcode": "^8.0",
"php": "^8.0.2",
"laravel/framework": "^9.19",
"laravel/tinker": "^2.7",
"laravolt/indonesia": "^0.32.0",
"livewire/livewire": "^2.10",
"milon/barcode": "^9.0",
"moneyphp/money": "^3.3",
"renatomarinho/laravel-page-speed": "^2.0",
"rezaamini-ir/migrator": "^1.5",
"sarfraznawaz2005/servermonitor": "^1.9",
"sentry/sentry-laravel": "^2.7",
"spatie/laravel-activitylog": "^3.17",
"spatie/laravel-menu": "^3.7",
"sarfraznawaz2005/servermonitor": "^3.1",
"spatie/laravel-activitylog": "^4.6",
"spatie/laravel-permission": "^5.4",
"wulfheart/pretty_routes": "^0.3.0",
"yajra/laravel-datatables": "1.5"
"yajra/laravel-datatables": "9.0"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.3",
"laravel/sail": "^1.0.1",
"laravel/pint": "^1.0",
"laravel/telescope": "^4.9",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 85917f1

Please sign in to comment.