Commit d22ae2a6 authored by Nicolas Widart's avatar Nicolas Widart

Fixing the routes, adding permissions filter

parent 21d7172b
<?php
$router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter|auth.admin'], function($router)
$router->group(['prefix' => LaravelLocalization::setLocale(), 'before' => 'LaravelLocalizationRedirectFilter|auth.admin|permissions'], function($router)
{
$router->group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\Media\Http\Controllers'], function($router)
{
$router->resource('media', 'Admin\MediaController', ['only' => ['store'], 'names' => [
$router->resource('media', 'Admin\MediaController', ['except' => ['show'], 'names' => [
'index' => 'dashboard.media.index',
'create' => 'dashboard.media.create',
'store' => 'dashboard.media.store',
'edit' => 'dashboard.media.edit',
'update' => 'dashboard.media.update',
'destroy' => 'dashboard.media.destroy',
]]);
});
});
$router->get('admin/grid-files', 'Modules\Media\Http\Controllers\Admin\MediaController@gridFiles');
$router->group(['prefix' => 'api', 'namespace' => 'Modules\Media\Http\Controllers'], function ($router) {
$router->resource('media', 'Api\MediaController');
$router->resource('media', 'Api\MediaController', ['only' => ['store']]);
});
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