Bristol SU Support Package
InjectModuleInstance.php
Go to the documentation of this file.
1 <?php
2 
3 
5 
6 
8 use Closure;
11 
16 {
17 
23  private $app;
24 
28  public function __construct(Container $app)
29  {
30  $this->app = $app;
31  }
32 
41  public function handle(Request $request, Closure $next)
42  {
43  $moduleInstance = $request->route('module_instance_slug');
44  $this->app->instance(ModuleInstance::class, $moduleInstance);
45 
46  return $next($request);
47  }
48 
49 }