Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)


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



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,

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
  1. 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...
  1. Display the breadcrumbs in your Blade views:
  • Use the @breadcrumbs directive in your Blade view to render the breadcrumbs. For example:
 
  1. 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


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.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(