for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* TrackingMiddleware.php
*
* This middleware will intercept traffic from visitors to
* your website.
* PHP version 7.2
* @category Middleware
* @package RedboxTracker
* @author Johnny Mast <[email protected]>
* @license https://opensource.org/licenses/MIT MIT
* @link https://github.com/johnnymast/redbox-tracker
* @since GIT:1.0
*/
namespace Redbox\Tracker\Middleware;
use Redbox\Tracker\Facades\Tracker;
use Closure;
* TrackingMiddleware class
* Model for website visitor requests.
class TrackingMiddleware
{
* Get the path the user should be redirected to when they are not authenticated.
* @param \Illuminate\Http\Request $request The incoming request
* @param Closure $next The next Middleware to execute.
* @return mixed
public function handle($request, Closure $next)
Tracker::recordVisit();
return $next($request);
}