Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Laravel dinamic toolbar


Hi, how do I change the toolbar with their respective breadcrumbs and actions for each page, as I see that this in a general way in the template.


<div class="d-flex flex-column flex-column-fluid">
@include(config("settings.KT_THEME_LAYOUT_DIR")."/partials/header-layout/_toolbar")
<!--begin::Content-->
<div id="kt_app_content" class="app-content flex-column-fluid">
<!--begin::Content container-->
<div id="kt_app_content_container" class="app-container container-xxl">
{{ $slot }}
</div>
<!--end::Content container-->
</div>
<!--end::Content-->
</div>


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


Hi Victor,

We apologize for the inconvenience. We are currently investigating the issue and will provide you with a solution as soon as possible. Thank you for your patience.



Hi,

Sorry for the delay.

To change the toolbar with their respective breadcrumbs and actions for each page in your Laravel Blade project using Metronic Laravel Starterkit, you can edit the following file:

starterkit/resources/views/layout/partials/header-layout/_toolbar.blade.php

In this file, you can modify the HTML and Blade code to customize the toolbar based on your requirements. You can add or remove breadcrumb elements, actions, or any other desired components to tailor the toolbar for each page.

To simplify the process of managing breadcrumbs in Laravel Blade, you can use the Laravel Breadcrumbs package. Here's how you can integrate it into your project:

1. Install the Laravel Breadcrumbs package via Composer:

composer require diglactic/laravel-breadcrumbs


2. Define your breadcrumbs:
- Create a new file, e.g., `breadcrumbs.php`, in the `routes` directory.
- Define your breadcrumbs using the provided syntax. Here's an example:

Breadcrumbs::for("home", function ($trail) {
$trail->push("Home", route("home"));
});

Breadcrumbs::for("about", function ($trail) {
$trail->parent("home");
$trail->push("About", route("about"));
});

// Define more breadcrumbs for other pages...


4. Display the breadcrumbs in your Blade views:
- Use the `@breadcrumbs` directive in your Blade view to render the breadcrumbs. For example:

<nav aria-label="breadcrumb">
<ol class="breadcrumb">
@breadcrumbs

</nav>


5. Set the breadcrumbs for each page:
- In your controller or route, call the `breadcrumbs` helper function to set the appropriate breadcrumbs for each page. For example:

public function index()
{
breadcrumbs(["home"]);
return view("your-view");
}

public function about()
{
breadcrumbs(["home", "about"]);
return view("your-view");
}


- In this example, the breadcrumbs are defined and assigned to each page using the breadcrumbs helper function.

By integrating the Laravel Breadcrumbs package, you can easily manage and display breadcrumbs in your Laravel Blade views. Refer to the package's documentation (https://github.com/diglactic/laravel-breadcrumbs) for more details on customizing and using the breadcrumb functionality.

Thanks



In the end I solved it using yield and section

resources\views\layout\_default_header_layout.blade.php

@yield("block-toolbar")

{{--
@include(config("settings.KT_THEME_LAYOUT_DIR")."/partials/header-layout/_toolbar")
--}}


My View

<x-default-layout>

@section("block-toolbar")
@include("./pages/campaigns/partials/_toolbar")

@endsection

<!-- next content view -->

</x-default-layout>


Thank you



Hi Victor,

I'm glad to hear that you were able to solve the issue it.

If you have any more questions or need further assistance, feel free to ask. I'm here to help!

Best regards,
Faizal


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(