{"repo":"spatie/laravel-referer","free":true,"listed":false,"github":"https://github.com/spatie/laravel-referer","clone":"git clone https://github.com/spatie/laravel-referer.git","description":"Remember a visitor's original referer","language":"PHP","stars":528,"topics":["laravel","seo","referer","http"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Remember a visitor's original referer Remember a visitor's original referer in session. The referer is (highest priority first): - The utm source query parameter - The domain from the request's Referer header if there's an external host in the URL - Empty Support us We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall. Installation You can install the package via composer: The package will automatically register itself in Laravel 5.5. In Laravel 5.4. you'll manually need to register the Spatie\\Referer\\RefererServiceProvider service provider in config/app.php . You can publish the config file with: Publishing the config file is necessary if you want to change the key in which the referer is stored in the session or if you want to disable a referer source. Usage To capture the referer, all you need to do is add the Spatie\\Referer\\CaptureReferer middleware to your middleware stack. In most configuration's, you'll only want to capture the referer in \"web\" requests, so it makes sense to register it in the web stack. Make sure it comes after Laravel's StartSession middleware! The easiest way to retrieve the referer is by just resolving it out of the container: Or you could opt to u","default_branch":null,"files":null,"tree":[],"storefront":"/r/spatie","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/spatie/laravel-referer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}