faisalahsan / laravel-breadcrums by faisalahsanse

A helper function to create breadcrums for you website
15
2
2
Package Data
Maintainer Username: faisalahsanse
Maintainer Contact: Faisalahsan.se@gmail.com (Faisal Ahsan)
Package Create Date: 2015-12-08
Package Last Update: 2015-12-09
Language: PHP
License: MIT
Last Refreshed: 2024-03-27 03:22:58
Package Statistics
Total Downloads: 15
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 2
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

Laravel Breadcrums

A laravel breadcrums that will automatically generate the navigation breadcrums that you will specify.

Installation

Perform the following operations in order to use this middleware

  • Run composer require faisalahsanse/laravel-breadcrums in your terminal

  • Add Service Provider Open config/app.php and add Faisalahsan\Breadcrums\BreadcumsServiceProvider::class to the end of providers array:

    'providers' => array(
        ....
        Faisalahsan\Breadcrums\BreadcumsServiceProvider::class,
    ),
    

How to use

  • Create a section breadcrums in your master layout (or whatever you are using)

    **blade template**
    @section('breadcrums')
    @show
    
  • Extend your page with your master layout, in which you want to show breadcrums and define an array of breadcrums.

    @extends('layouts.master')    
    @section('breadcrums')
    	{{-- */
    		$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page', 
                                'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
                    					  			   'myFirstPageRouteName' => 'Previous First Page',
    	                    					   ...
    	                    					 ]];
    	/* --}}
    	{{ breadcrums( $breadcrumbLinks )}}
    @show
    
  • Use routes without parameters

    section('breadcrums')
    	{{-- */
    		$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page', 
                                'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
                    					  			   'myFirstPageRouteName' => 'Previous First Page',
    	                    					   ...
    	                    					 ]];
    	/* --}}
    	{{ breadcrums( $breadcrumbLinks )}}
    @show
    
  • Use routes parameters

    section('breadcrums')
    	{{-- */
    		$breadcrumbLinks =[ 'currentPageDisplayName' => 'My Current Page', 
                                'breadcrumbLinks' => [ 'mySecondPageRouteName' => 'Previous Second Page',
                    					  			   'myFirstPageRouteName'  => 'Previous First Page',
                    					  			   'myRouteWithParameters' => [ 'routedDisplayName' => 'Route With Parameter', 
                                                                					'routedParameters'  =>['firstParamName' => 'firstParamValue',
    				                                                                				   'secondParamName' => 'secondParamValue',
    				                                                                				   ....
    				                                                                				]]
    	                    					   ...
    	                    					 ]];
    	/* --}}
    	{{ breadcrums( $breadcrumbLinks )}}
    @show
    
  • Customize style of breadcrums navigation

    *breadcrumb** class define html tag **ul**
    *breadcrumb-item** class define html tag **li*8 of **ul**
    

How to Contribute

  • Feel free to add some new functionality, improve some existing functionality etc and open up a pull request explaining what you did.
  • Report any issues in the issues section
  • Also you can reach me directly at faisalahsan.se@gmail.com with any feedback