Skip to content

Commit

Permalink
- laravel 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
toni-suarez committed Mar 16, 2024
1 parent 57a3913 commit decf907
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests-php8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

strategy:
matrix:
laravel: ['10.*', '11.*']
php: [8.1, 8.2]
laravel: ['11.*']
php: [8.1, 8.2, 8.3]
exclude:
- laravel: '11.*'
php: 8.1
Expand Down
33 changes: 0 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ $ composer require suarez/laravel-utm-parameter

### Middleware

#### Laravel 11

Open the `bootstrap/app.php` file and append the `UtmParameters::class` inside the web-group

```php
Expand Down Expand Up @@ -91,37 +89,6 @@ Route::middleware('utm-parameters')
->get('langing-page/{slug}', 'LandingPageController@show');
```

#### Laravel 10

Open the `app/Http/Kernel.php` file and add a new item to the `web` middleware group:

```php
# Laravel 10 and below
protected $middlewareGroups = [
'web' => [
/* ... keep the existing middleware here */
\Suarez\UtmParameter\Middleware\UtmParameters::class,
],
];
```

To enable UTM-Parameters only for certain requests to your site, add a new mapping to the `middlewareAliases` Array.

```php
# Laravel 10 and below
protected $middlewareAliases = [
/* ... keep the existing mappings here */
'utm-parameters' => \Suarez\UtmParameter\Middleware\UtmParameters::class,
];
```

To apply UTM-Parameters to specific routes, use the following middleware: `utm-parameters`

```php
Route::middleware('utm-parameters')
->get('langing-page/{slug}', 'LandingPageController@show');
```

## Usage

### All UTM parameters
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
}
],
"require": {
"php": "^8.1|^8.2",
"illuminate/support": "^10.0|^11.0",
"illuminate/contracts": "^10.0|^11.0"
"php": "^8.2",
"illuminate/support": "^11.0",
"illuminate/contracts": "^11.0"
},
"require-dev": {
"nunomaduro/collision": "^7.0|^8.1",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"nunomaduro/collision": "^8.1",
"orchestra/testbench": "^9.0",
"phpunit/phpunit": "^9.5|^10.0",
"friendsofphp/php-cs-fixer": "^3.0"
},
Expand Down

0 comments on commit decf907

Please sign in to comment.