42 lines
1.1 KiB
PHP
42 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class MenuServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot(Request $request)
|
|
{
|
|
// get all data from menu.json file
|
|
|
|
$verticalMenuJson = file_get_contents(base_path('resources/data/menu-data/verticalMenu.json'));
|
|
$verticalMenuData = json_decode($verticalMenuJson);
|
|
$horizontalMenuJson = file_get_contents(base_path('resources/data/menu-data/horizontalMenu.json'));
|
|
$horizontalMenuData = json_decode($horizontalMenuJson);
|
|
|
|
$verticalManagerMenuJson = file_get_contents(base_path('resources/data/menu-data/verticalMenuManager.json'));
|
|
$verticalManagerMenuJson = json_decode($verticalManagerMenuJson);
|
|
|
|
// Share all menuData to all the views
|
|
\View::share('menuData', [$verticalMenuData, $horizontalMenuData, $verticalManagerMenuJson]);
|
|
}
|
|
}
|