Comments (9)
There is no Laravel 4.42 so I assume you mean 4.2?
Breadcrumbs 3 is only compatible with Laravel 5. Did you follow the instructions to install Breadcrumbs 2?
Is it installed correctly in the vendor/davejamesmiller/laravel-breadcrumbs/
directory?
from laravel-breadcrumbs.
Yes, I have Breadcrumb 2 invendor/davejamesmiller/laravel-breadcrumbs/
Directory also I follow all instructions.
from laravel-breadcrumbs.
Please provide the more detail as per https://github.com/davejamesmiller/laravel-breadcrumbs/blob/master/CONTRIBUTING.rst. Thanks
from laravel-breadcrumbs.
I follow each step which is given here:
https://github.com/davejamesmiller/laravel-breadcrumbs/tree/2.x
Do you want me to share my code setting which I did?
from laravel-breadcrumbs.
Yes, I want you to read the link - particularly the bit which starts "All support requests / bug reports should include the following:".
from laravel-breadcrumbs.
Here is the process which I follow in installation and setting:
- I run following command to install:
composer require davejamesmiller/laravel-breadcrumbs:2.*
- After successful installation I put below code in app/config/app.php:
'providers' => array(
// ...
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
),
And:
'aliases' => array(
// ...
'Breadcrumbs' => 'DaveJamesMiller\Breadcrumbs\Facade',
),
- Then I have create a file call breadcrums.php in my app folder and put below code in breadcrums.php file:
<?php
Breadcrumbs::register('home', function($breadcrumbs) {
$breadcrumbs->push('Home', route('home'));
});
Breadcrumbs::register('blog', function($breadcrumbs) {
$breadcrumbs->parent('home');
$breadcrumbs->push('Blog', route('blog'));
});
Breadcrumbs::register('category', function($breadcrumbs, $category) {
$breadcrumbs->parent('blog');
foreach ($category->ancestors as $ancestor) {
$breadcrumbs->push($ancestor->title, route('category', $ancestor->id));
}
$breadcrumbs->push($category->title, route('category', $category->id));
});
Breadcrumbs::register('page', function($breadcrumbs, $page) {
$breadcrumbs->parent('category', $page->category);
$breadcrumbs->push($page->title, route('page', $page->id));
});
- Then I create a view file in following path: `app/views/_partials/breadcrumbs.blade.php``` and put below code:
@if ($breadcrumbs)
<ul class="breadcrumb">
@foreach ($breadcrumbs as $breadcrumb)
@if (!$breadcrumb->last)
<li><a href="{{{ $breadcrumb->url }}}">{{{ $breadcrumb->title }}}</a></li>
@else
<li class="active">{{{ $breadcrumb->title }}}</li>
@endif
@endforeach
</ul>
@endif
- Then I add below code in my config app.php file:
'view' => '_partials.breadcrumbs',
- In final step I call Breadcrumb in my view file:
{{ Breadcrumbs::render('home') }}
{{ Breadcrumbs::render('category', $category) }}
But it give me Class 'DaveJamesMiller\Breadcrumbs\ServiceProvider' not found
error.
Can you please guide me how I can fix the problem?
Thanks in advance.
from laravel-breadcrumbs.
I have added code blocks markers to your message to make it readable - please see here if you aren't familiar with Markdown: https://help.github.com/articles/github-flavored-markdown/
I assume you didn't add the following code literally, but added the service provider to the end of the existing array? Can you show the the actual code in full? Maybe just paste in the whole file (other than encryption key or other sensitive things?
'providers' => array(
// ...
'DaveJamesMiller\Breadcrumbs\ServiceProvider',
),
Otherwise I can't see anything wrong.
Can you check what is in the file vendor/composer/autoload_namespaces.php
?
Please also run these commands and paste the output:
composer status
composer show -i
from laravel-breadcrumbs.
I had the same problem.
I run: "composer update" and the problem was solved.
from laravel-breadcrumbs.
You need to comment the following line in config/app.php (and then uncomment once composer has done its thing).
DaveJamesMiller\Breadcrumbs\ServiceProvider::class,
I got to know about this solution from here and worked for me also.
from laravel-breadcrumbs.
Related Issues (20)
- Dynamic breadcrumb - Trying to get property of non-object HOT 1
- Error logging
- Feature Request: Be able to pass the register name to the call back function HOT 1
- After execute the publish command, the config file not appear HOT 1
- json-ld Unspecified Type HOT 2
- Error en Ubuntu HOT 2
- Same errors with $breadcrumbs HOT 2
- Generate breadcrumbs for tabbed content HOT 4
- Wrong Readme Method parameter reference
- Method for does not exist. HOT 2
- can't get post category HOT 12
- How to pass the value to the bread crumbs with my admin panel? HOT 1
- It would be nice if I could put icons like this: HOT 1
- Laravel 5.7 Released HOT 1
- Add Laravel 5.7 support HOT 1
- installed the package and got Class 'Breadcrumbs' not found error HOT 2
- Feature Request UIKit breadcrumbs HOT 6
- Does this package even works??? HOT 3
- "Home" breadcrumb shows up twice, unable to remove it HOT 3
- breadcrumb 4 levels HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-breadcrumbs.