TIP 11 / 20

Blade Directives: Includeif, Includewhen, Includefirst.

If you are not sure whether your Blade partial file actually would exist, you may use these condition commands:

This will load header only if Blade file exists

blade
@includeIf('partials.header')

This will load header only for user with role_id 1

blade
@includeWhen(auth()->user()->role_id == 1, 'partials.header')

This will try to load adminlte.header, if missing - will load default.header

blade
@includeFirst('adminlte.header', 'default.header')