Skip to content

Commit

Permalink
Updating the service providers
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Feb 9, 2017
1 parent bdd6618 commit 1ea261c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 14 deletions.
2 changes: 0 additions & 2 deletions src/MediaServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php namespace Arcanesoft\Media;

use Arcanesoft\Core\Bases\PackageServiceProvider;
use Arcanesoft\Core\CoreServiceProvider;

/**
* Class MediaServiceProvider
Expand Down Expand Up @@ -50,7 +49,6 @@ public function register()
$this->registerConfig();
$this->registerSidebarItems();
$this->registerProviders([
CoreServiceProvider::class,
Providers\PackagesServiceProvider::class,
Providers\AuthorizationServiceProvider::class,
]);
Expand Down
2 changes: 1 addition & 1 deletion src/Providers/AuthorizationServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace Arcanesoft\Media\Providers;

use Arcanedev\Support\ServiceProvider;
use Arcanedev\Support\Providers\AuthorizationServiceProvider as ServiceProvider;

/**
* Class AuthorizationServiceProvider
Expand Down
17 changes: 6 additions & 11 deletions src/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use Arcanesoft\Core\Bases\RouteServiceProvider as ServiceProvider;
use Arcanesoft\Media\Http\Routes;
use Illuminate\Contracts\Routing\Registrar as Router;

/**
* Class RouteServiceProvider
Expand All @@ -18,12 +17,10 @@ class RouteServiceProvider extends ServiceProvider
*/
/**
* Define the routes for the application.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
public function map(Router $router)
public function map()
{
$this->mapAdminRoutes($router);
$this->mapAdminRoutes();
}

/* ------------------------------------------------------------------------------------------------
Expand All @@ -32,20 +29,18 @@ public function map(Router $router)
*/
/**
* Register the admin routes.
*
* @param \Illuminate\Contracts\Routing\Registrar $router
*/
private function mapAdminRoutes(Router $router)
private function mapAdminRoutes()
{
$attributes = $this->getAdminAttributes(
'media.',
'Arcanesoft\\Media\\Http\\Controllers\\Admin',
$this->config()->get('arcanesoft.media.route.prefix', 'media')
);

$router->group($attributes, function ($router) {
Routes\Admin\MediaRoutes::register($router);
Routes\Admin\ApiRoutes::register($router); // TODO: Adding `api` or `ajax` middleware ?
$this->group($attributes, function () {
Routes\Admin\MediaRoutes::register();
Routes\Admin\ApiRoutes::register(); // TODO: Adding `api` or `ajax` middleware ?
});
}
}

0 comments on commit 1ea261c

Please sign in to comment.