Skip to content

Commit

Permalink
Merge pull request #30 from ranjeetmali/ranjeet_work
Browse files Browse the repository at this point in the history
Laravel 10.x update
  • Loading branch information
harish81 committed Oct 20, 2023
2 parents 0d8a021 + c0b96bb commit 139aad3
Show file tree
Hide file tree
Showing 21 changed files with 3,324 additions and 4,545 deletions.
2 changes: 1 addition & 1 deletion app/DataTables/CustomFieldDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function getColumns()
*
* @return string
*/
protected function filename()
protected function filename(): string
{
return 'custom_fieldsdatatable_' . time();
}
Expand Down
2 changes: 1 addition & 1 deletion app/DataTables/FileTypeDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function getColumns()
*
* @return string
*/
protected function filename()
protected function filename(): string
{
return 'file_typesdatatable_' . time();
}
Expand Down
2 changes: 1 addition & 1 deletion app/DataTables/SettingDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function getColumns()
*
* @return string
*/
protected function filename()
protected function filename(): string
{
return 'settingsdatatable_' . time();
}
Expand Down
2 changes: 1 addition & 1 deletion app/DataTables/TagDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function getColumns()
*
* @return string
*/
protected function filename()
protected function filename(): string
{
return 'tagsdatatable_' . time();
}
Expand Down
2 changes: 1 addition & 1 deletion app/DataTables/UserDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected function getColumns()
*
* @return string
*/
protected function filename()
protected function filename(): string
{
return 'usersdatatable_' . time();
}
Expand Down
5 changes: 3 additions & 2 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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

class Handler extends ExceptionHandler
{
Expand Down Expand Up @@ -32,7 +33,7 @@ class Handler extends ExceptionHandler
* @param \Exception $exception
* @return void
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
parent::report($exception);
}
Expand All @@ -44,7 +45,7 @@ public function report(Exception $exception)
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
Expand Down
9 changes: 7 additions & 2 deletions app/Http/Middleware/TrustProxies.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

namespace App\Http\Middleware;

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

class TrustProxies extends Middleware
{
Expand All @@ -19,5 +20,9 @@ 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;
}
49 changes: 16 additions & 33 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;

class RouteServiceProvider extends ServiceProvider
{
Expand All @@ -25,49 +28,29 @@ public function boot()
{
//

parent::boot();
}

/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();

$this->mapWebRoutes();
$this->configureRateLimiting();

//
}
$this->routes(function () {
Route::middleware('api')
->prefix('api')
->group(base_path('routes/api.php'));

/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::middleware('web')
->group(base_path('routes/web.php'));
});
}

/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
* Configure the rate limiters for the application.
*
* @return void
*/
protected function mapApiRoutes()
protected function configureRateLimiting()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip());
});
}
}
47 changes: 21 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,30 @@
],
"license": "MIT",
"require": {
"php": "^7.2",
"php": "^8.1",
"ext-fileinfo": "*",
"ext-zip": "*",
"barryvdh/laravel-dompdf": "^0.8.5",
"fideloper/proxy": "^4.0",
"infyomlabs/adminlte-templates": "6.0.x-dev",
"infyomlabs/laravel-generator": "6.0.x-dev",
"barryvdh/laravel-dompdf": "^2.0",
"guzzlehttp/guzzle": "^7.5.0",
"intervention/image": "^2.5",
"laravel/framework": "^6.2",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^6.0",
"spatie/laravel-permission": "^3.2",
"stevebauman/purify": "^4.0",
"yajra/laravel-datatables-buttons": "^4.8",
"yajra/laravel-datatables-html": "^4.19",
"yajra/laravel-datatables-oracle": "~9.0"
"laracasts/flash": "^3.2",
"laravel/framework": "^10.0",
"laravel/tinker": "^2.0",
"laravelcollective/html": "^6.3",
"spatie/laravel-permission": "^5.0",
"stevebauman/purify": "^6.0",
"yajra/laravel-datatables-buttons": "^10.0",
"yajra/laravel-datatables-html": "^10.0",
"yajra/laravel-datatables-oracle": "^10.3.1"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-ide-helper": "^2.6",
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"laravel/ui": "^1.1",
"fakerphp/faker": "^1.21",
"laravel/ui": "^4.0",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -50,19 +48,16 @@
"app/Http/helper.php"
],
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
Expand Down

0 comments on commit 139aad3

Please sign in to comment.