famdirksen/laravel-utm-urls

This package will add utm attributes to all urls

0.4.1 2020-10-08 07:42 UTC

README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Install

Via Composer

$ composer require famdirksen/laravel-utm-urls

Usage

Add the \Famdirksen\LaravelUTMUrls\Middleware\SetUTMUrls::class to your app/Http/Kernel.php. Thisway all the url's on your site will have the UTM attributes from the config file (utm-urls.php) added.

To disable the UTM attributes appended to a url on specific routes, you can add the follow middleware to the route or group: \Famdirksen\LaravelUTMUrls\Middleware\DisableUTMUrls::class. This will set the header x-do-not-append-campagne so it won't append the UTM attributes.

You can publish the config file with:

php artisan vendor:publish --provider="Famdirksen\LaravelUTMUrls\LaravelUTMUrlsServiceProvider"

Testing

$ composer test

Security

If you discover any security related issues, please email info@famdirksen.nl instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.