-
-
Notifications
You must be signed in to change notification settings - Fork 2
Installation Guide (Laravel 8.x to 10.x)
The Laravel UTM-Parameters package provides a lightweight way to handle UTM parameters session-based in your Laravel application. This guide will walk you through the installation process step by step.
Before installing the package, ensure that you have the following prerequisites:
- Laravel framework installed (version 8.x to 10.x)
- Composer globally installed on your system
Follow these steps to install the Laravel UTM-Parameters package:
Open your terminal and navigate to your Laravel project directory. Then, use Composer to install the package:
composer require suarez/laravel-utm-parameter
Once the package is installed, you need to add the UtmParameters middleware to your Laravel application.
Open the app/Http/Kernel.php file and append the UtmParameters middleware to the web group:
use Suarez\UtmParameter\Middleware\UtmParameters;
protected $middlewareGroups = [
'web' => [
// Other middleware...
UtmParameters::class,
],
];
To enable UTM-Parameters only for certain requests or routes in your application, you can add an alias for the UtmParameters middleware.
Open the app/Http/Kernel.php file and append the UtmParameters middleware to the web group:
use Suarez\UtmParameter\Middleware\UtmParameters;
protected $middlewareGroups = [
'web' => [
// Other middleware...
'utm-parameters' => UtmParameters::class,
],
];
You can now start using the UTM-Parameters package in your Laravel application. Refer to the package documentation for information on how to retrieve and utilize UTM parameters in your controllers, views, or other parts of your application.
Congratulations! You have successfully installed the Laravel UTM-Parameters package in your Laravel application. You can now start tracking and managing UTM parameters in your application to enhance user experience.