Home > Net >  What is in a Laravel application are Menu::render(), Assets::render(), Notify::render()?
What is in a Laravel application are Menu::render(), Assets::render(), Notify::render()?

Time:03-07

I'm working on a Laravel app that I haven't coded. I need to do some modifications and in my Blade templates I see some code like this:

 {!! Menu::render('client', 1, 1) !!}
{!! Assets::renderCss() !!}
{!! Notify::render() !!}
{!! Assets::renderJs() !!}

I understand that it's used to link some code like stylesheets, Javascript or a menu but I can't find these functions. I searched a little in the Laravel documentation but got no results. Are there some custom functions in my app?

The development environment is not very convenient and I can't search into the whole files. I wanted to modify the related menu and I didn't find the files where I have to modify.

CodePudding user response:

In config/app.php, you'll see a list of class aliases/facades:

'aliases' => [
    // ...
    'Menu' => App\Facades\Menu::class,
    // ...
],

In this example, App\Facades\Menu would be the file app/Facades/Menu.php. If you can't find the listed file path, it's likely from a vendor file. For example, you'll probably see 'Cache' => Illuminate\Support\Facades\Cache::class, which comes with Laravel and is documented in the main Laravel documentation and the Laravel API documentation. Packages may also be autodiscovered as of Laravel 5.5, so check your composer.json for what third-party libraries you're using.

  • Related