Skip to content

Commit

Permalink
add middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Sep 13, 2024
1 parent f03c1f9 commit aeb8fda
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Middleware/SeoNoIndexMiddleware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Elegantly\Seo\Middleware;

use Closure;
use Elegantly\Seo\Facades\SeoManager;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class SeoNoIndexMiddleware
{
/**
* Handle an incoming request.
*
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next): Response
{
SeoManager::current()->noIndex();

return $next($request);
}
}

0 comments on commit aeb8fda

Please sign in to comment.