Skip to content

Commit

Permalink
Get rid of menu package for now
Browse files Browse the repository at this point in the history
  • Loading branch information
mpociot committed Feb 8, 2018
1 parent 99104b3 commit 2a42606
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 87 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"illuminate/support": "~5.5.0",
"illuminate/contracts": "~5.5.0",
"illuminate/console": "~5.5.0",
"thecodingmachine/discovery": "^1.2",
"spatie/laravel-menu": "^3.0"
"thecodingmachine/discovery": "^1.2"
},
"require-dev": {
"phpunit/phpunit": "~6.0",
Expand Down
46 changes: 0 additions & 46 deletions src/Providers/StudioServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use View;
use Illuminate\Http\Request;
use Spatie\Menu\Laravel\Menu;
use Illuminate\Support\ServiceProvider;
use TheCodingMachine\Discovery\Discovery;
use BotMan\Studio\Console\Commands\BotManListDrivers;
Expand All @@ -27,20 +26,6 @@ public function register()
]);

$this->discoverCommands();

$this->registerRouteHelper();

$this->registerMenu();
}

/**
* Pass BotMan Studio menu to all studio views.
*/
public function boot()
{
View::composer('studio::*', function ($view) {
$view->with('menu', $this->app->make('studio.menu'));
});
}

/**
Expand All @@ -50,35 +35,4 @@ public function discoverCommands()
{
$this->commands(Discovery::getInstance()->get('botman/commands'));
}

/**
* Register BotMan Studio related route helpers.
*/
protected function registerRouteHelper()
{
Request::macro('section', function () {
if ($this->segment(1) === 'studio') {
return 'studio';
}

return 'web';
});
Request::macro('isWeb', function () {
return request()->section() === 'web';
});
Request::macro('isStudio', function () {
return request()->section() === 'studio';
});
}

/**
* Register BotMan Studio Menus.
*/
protected function registerMenu()
{
$this->app->singleton('studio.menu', function ($app) {
return Menu::new()
->setActiveFromRequest();
});
}
}
39 changes: 0 additions & 39 deletions tests/ProviderTest.php

This file was deleted.

0 comments on commit 2a42606

Please sign in to comment.