public function registerRoutes()
	{
		$this->registerAssetsRoutes();
		$this->registerAuthRoutes();
		$this->registerImageCacheRoute();

		$models = Admin::instance()->models->getAllAliases();

		$this->laravelRouter->group([
			'prefix'    => $this->prefix,
			'before'    => $this->getBeforeFilters(),
			'namespace' => 'SleepingOwl\Admin\Controllers',
		], function () use ($models)
		{
			if (empty($models)) $models = ['__empty_models__'];
			$this->laravelRouter->group([
				'where' => ['model' => implode('|', $models)]
			], function ()
			{
				foreach (static::$modelRoutes as $route)
				{
					$url = $route['url'];
					$action = $route['action'];
					$method = $route['method'];
                    			$controller = isset($route['controller']) ? $route['controller'] : 'AdminController';
                    			$this->laravelRouter->$method($url, [
						'as'   => $this->routePrefix . '.table.' . $action,
						'uses' => $controller . '@' . $action
					]);
				}
			});

			$wildcardRoute = $this->laravelRouter->any('{wildcard?}', [
				'as'   => $this->routePrefix . '.wildcard',
				'uses' => 'AdminController@getWildcard'
			])->where('wildcard', '.*');
			$this->setRoutePriority($wildcardRoute, 0);
		});
	}
public function registerRoutes()
	{
		$this->registerAssetsRoutes();
		$this->registerAuthRoutes();
		$this->registerImageCacheRoute();

		$models = Admin::instance()->models->getAllAliases();

		$this->laravelRouter->group([
			'prefix'    => $this->prefix,
			'before'    => $this->getBeforeFilters(),
			'namespace' => 'SleepingOwl\Admin\Controllers',
		], function () use ($models)
		{
			if (empty($models)) $models = ['__empty_models__'];
			$this->laravelRouter->group([
				'where' => ['model' => implode('|', $models)]
			], function ()
			{
				foreach (static::$modelRoutes as $route)
				{
					$url = $route['url'];
					$action = $route['action'];
					$method = $route['method'];
                    			$controller = isset($route['controller']) ? $route['controller'] : 'AdminController';
                    			$this->laravelRouter->$method($url, [
						'as'   => $this->routePrefix . '.table.' . $action,
						'uses' => $controller . '@' . $action
					]);
				}
			});

			$wildcardRoute = $this->laravelRouter->any('{wildcard?}', [
				'as'   => $this->routePrefix . '.wildcard',
				'uses' => 'AdminController@getWildcard'
			])->where('wildcard', '.*');
			$this->setRoutePriority($wildcardRoute, 0);
		});
	}
public function registerRoutes ( ) { $ this -> registerAssetsRoutes ( ) ; $ this -> registerAuthRoutes ( ) ; $ this -> registerImageCacheRoute ( ) ; $ models = Admin :: instance ( ) -> models -> getAllAliases ( ) ; $ this -> laravelRouter -> group ( [ 'prefix' => $ this -> prefix , 'before' => $ this -> getBeforeFilters ( ) , 'namespace' => 'SleepingOwl\Admin\Controllers' , ] , function ( ) use ( $ models ) { if ( empty ( $ models ) ) $ models = [ '__empty_models__' ] ; $ this -> laravelRouter -> group ( [ 'where' => [ 'model' => implode ( '|' , $ models ) ] ] , function ( ) { foreach ( static :: $ modelRoutes as $ route ) { $ url = $ route [ 'url' ] ; $ action = $ route [ 'action' ] ; $ method = $ route [ 'method' ] ; $ controller = isset ( $ route [ 'controller' ] ) ? $ route [ 'controller' ] : 'AdminController' ; $ this -> laravelRouter -> $ method ( $ url , [ 'as' => $ this -> routePrefix . '.table.' . $ action , 'uses' => $ controller . '@' . $ action ] ) ; } } ) ; $ wildcardRoute = $ this -> laravelRouter -> any ( '{wildcard?}' , [ 'as' => $ this -> routePrefix . '.wildcard' , 'uses' => 'AdminController@getWildcard' ] ) -> where ( 'wildcard' , '.*' ) ; $ this -> setRoutePriority ( $ wildcardRoute , 0 ) ; } ) ; }
Register all admin routes
Register all admin routes