Skip to content

Commit

Permalink
Change middleware approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Mar 8, 2024
1 parent 20b337a commit 996e462
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/Middleware/MinifyMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

class MinifyMiddleware
{
private $minPath = 'min/';
private $ignoreUrls = [];

/**
* before response sent back to browser
*/
Expand Down
9 changes: 6 additions & 3 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@

namespace Thoughtco\Minify;

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Support\Facades\File;
use Statamic\Providers\AddonServiceProvider;
use Statamic\Statamic;
use Thoughtco\Minify\Middleware\MinifyMiddleware;

class ServiceProvider extends AddonServiceProvider
{
protected $middlewareGroups = [
'web' => [
MinifyMiddleware::class,
],
];

public function boot()
{
parent::boot();

app(Kernel::class)->pushMiddleware(MinifyMiddleware::class);

Statamic::afterInstalled(function ($command) {

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

0 comments on commit 996e462

Please sign in to comment.