Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace App\Exceptions;

use Exception;
use Throwable;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
Expand All @@ -22,16 +22,19 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* @param \Exception $exception
* @param \Throwable $exception
* @return void
*
* @throws \Throwable
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
Expand All @@ -40,10 +43,12 @@ public function report(Exception $exception)
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
* @param \Throwable $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Throwable
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
Expand Down
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 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;

Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion app/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Nicolaslopezj\Searchable\SearchableTrait;
use Stephenjude\DefaultModelSorting\Traits\DefaultOrderBy;
use App\Traits\DefaultOrderBy;

class Member extends Model {

Expand Down
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Providers;

use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -23,6 +24,6 @@ public function register()
*/
public function boot()
{
//
Paginator::useBootstrap();
}
}
22 changes: 22 additions & 0 deletions app/Traits/DefaultOrderBy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace App\Traits;

use Illuminate\Database\Eloquent\Builder;

trait DefaultOrderBy
{
protected static function bootDefaultOrderBy()
{
if (empty(static::$orderByColumn)) {
return;
}

$column = static::$orderByColumn;
$direction = static::$orderByColumnDirection ?? 'asc';

static::addGlobalScope('default_order_by', function (Builder $builder) use ($column, $direction) {
$builder->orderBy($column, $direction);
});
}
}
47 changes: 24 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,32 @@
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"barryvdh/laravel-debugbar": "^3.2",
"doctrine/dbal": "2.*",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.6",
"laravel/framework": "5.8.*",
"laravel/socialite": "4.4.1",
"laravel/tinker": "^1.0",
"nicolaslopezj/searchable": "1.*",
"stephenjude/default-model-sorting": "1.0"
"php": "^8.1",
"barryvdh/laravel-debugbar": "^3.9",
"doctrine/dbal": "^3.5",
"intervention/image": "^2.7",
"laravel/framework": "^10.48",
"laravel/socialite": "^5.6",
"laravel/tinker": "^2.8",
"laravel/ui": "^4.5",
"nicolaslopezj/searchable": "1.*"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5"
"fakerphp/faker": "^1.9.1",
"filp/whoops": "^2.14",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"extra": {
"laravel": {
Expand All @@ -39,12 +42,10 @@
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
Expand Down
Loading