Commit 74220510 authored by Nicolas Widart's avatar Nicolas Widart

Using the base filter class from the core module

parent 47a54a90
<?php namespace Modules\Workshop\Http\Filters;
class PermissionFilter {
public function filter()
{
//
}
}
\ No newline at end of file
......@@ -18,7 +18,9 @@ class WorkshopServiceProvider extends ServiceProvider
* @var array
*/
protected $filters = [
'permissions' => 'PermissionFilter'
'Core' => [
'permissions' => 'PermissionFilter'
]
];
/**
......@@ -29,10 +31,12 @@ class WorkshopServiceProvider extends ServiceProvider
*/
public function registerFilters(Router $router)
{
foreach ($this->filters as $name => $filter) {
$class = 'Modules\\Workshop\\Http\\Filters\\' . $filter;
foreach ($this->filters as $module => $filters) {
foreach ($filters as $name => $filter) {
$class = "Modules\\{$module}\\Http\\Filters\\{$filter}";
$router->filter($name, $class);
$router->filter($name, $class);
}
}
}
......@@ -43,11 +47,9 @@ class WorkshopServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app->booted(
function ($app) {
$this->registerFilters($app['router']);
}
);
$this->app->booted(function ($app) {
$this->registerFilters($app['router']);
});
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment