Skip to content

Commit 996e462

Browse files
committed
Change middleware approach
1 parent 20b337a commit 996e462

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Middleware/MinifyMiddleware.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class MinifyMiddleware
99
{
10-
private $minPath = 'min/';
11-
private $ignoreUrls = [];
12-
1310
/**
1411
* before response sent back to browser
1512
*/

src/ServiceProvider.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
namespace Thoughtco\Minify;
44

5-
use Illuminate\Contracts\Http\Kernel;
65
use Illuminate\Support\Facades\File;
76
use Statamic\Providers\AddonServiceProvider;
87
use Statamic\Statamic;
98
use Thoughtco\Minify\Middleware\MinifyMiddleware;
109

1110
class ServiceProvider extends AddonServiceProvider
1211
{
12+
protected $middlewareGroups = [
13+
'web' => [
14+
MinifyMiddleware::class,
15+
],
16+
];
17+
1318
public function boot()
1419
{
1520
parent::boot();
1621

17-
app(Kernel::class)->pushMiddleware(MinifyMiddleware::class);
18-
1922
Statamic::afterInstalled(function ($command) {
2023

2124
if (File::exists(config_path('thoughtco/minify.php')))

0 commit comments

Comments
 (0)