36 lines
683 B
PHP
36 lines
683 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Category;
|
|
use Illuminate\Support\Facades\View;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot()
|
|
{
|
|
View::composer('layouts.left_menu', function ($view) {
|
|
$cats = Category::where('depth',1)
|
|
->orderBy('lft')
|
|
->get();
|
|
$view->with('mainCategories',$cats);
|
|
});
|
|
}
|
|
}
|