PHP code example of bocanhcam / nova-breadcrumb

1. Go to this page and download the library: Download bocanhcam/nova-breadcrumb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

bocanhcam / nova-breadcrumb example snippets


use Laravel\Nova\Nova;

/**
 * Boot any application services.
 *
 * @return void
 */
public function boot()
{
    parent::boot();

    Nova::withBreadcrumbs();
}

use Bocanhcam\NovaBreadcrumb\Breadcrumb;
use Bocanhcam\NovaBreadcrumb\Breadcrumbs;
use Bocanhcam\NovaBreadcrumb\HTML;
use Bocanhcam\NovaBreadcrumb\Icon;
use Bocanhcam\Nova\Http\Requests\NovaRequest;

class YourResource extends Resource
{
    public function breadcrumbsForIndex(NovaRequest $request): Breadcrumbs
    {
        return Breadcrumbs::make([
            Breadcrumb::make(Icon::make('home')->append(__('Home')), '/'),
            Breadcrumb::make(__('Resource Index'), '/nova/resources/events'),
        ]);
    }

    public function breadcrumbsForDetail(NovaRequest $request): Breadcrumbs
    {
        return Breadcrumbs::make([
            Breadcrumb::make(HTML::make(view('partials.home')->render()), '/'),
            Breadcrumb::make(__('Resource Index'), '/resources/events'),
            Breadcrumb::make(__('Events Detail')),
        ]);
    }
}

Breadcrumb::make(Icon::make('home')->append(__('Home')), '/'),

Breadcrumb::make(HTML::make(view('partials.home')->render()), '/');
shell
php artisan nova:breadcrumbs