Skip to content

Commit

Permalink
Bind middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
reindert-vetter committed Sep 13, 2021
1 parent 07542e1 commit d263c39
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/Middleware/Version/Bind.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);

namespace ReindertVetter\ApiVersionControl\Middleware\Version;

use Closure;
use Illuminate\Http\Request;

class Bind
{
private $abstract;
private $conrete;

public function __construct($abstract, $conrete)
{
$this->abstract = $abstract;
$this->conrete = $conrete;
}

public function handle(Request $request, Closure $next)
{
app()->bind($this->abstract, $this->conrete);

return $next($request);
}
}

0 comments on commit d263c39

Please sign in to comment.