-
Notifications
You must be signed in to change notification settings - Fork 415
Laravel 5 - BadMethodCallException in ServiceProvider.php line 111: Call to undefined method [package] #62
Comments
I assume this is in Laravel 5 (dev-master version) - it's related to this commit but I don't yet know what the correct fix for it is so I'm planning to leave it until nearer the release date unless anyone knows the correct solution. |
Could fix using the info in the comments commit there. Anyway I am new to Laravel and find what the package method was used for very weird if configs could just be cascaded. I fixed it by creating my own provider as temporary solution using
|
FYI, you can probably simplify that by extending my class instead of re-implementing the whole thing (untested): <?php namespace App\Providers;
use DaveJamesMiller\Breadcrumbs\ServiceProvider as BaseServiceProvider;
class BreadcrumbsServiceProvider extends BaseServiceProvider
{
protected function package() {}
} Thanks for pointing out the updated comments in the commit above, but it still looks like a workaround rather than a solution so I'm going to wait to see what the official word is when the documentation is finally updated before I spend more time on it. |
For anyone that wants to use this in L5 at the moment... I've forked the repo, which is now compatible with L5's new package structure now that it's documented. |
Do you have a URL for your fork? I couldn't find it. I'll try to read up on the changes soon and release an update, but probably not this week. I'm thinking about making a new major release at the same time - dropping support for 4.x (rather than trying to maintain compatibility in a single branch) and taking advantage of some of the L5 changes (like improved service provider support). |
Ah yep, I should've linked that. It's https://github.com/industrious-mouse/laravel-breadcrumbs/tree/develop Yeah I would imagine that's the route a lot of package developers are going to take, it's quite a big breaking change removing the l4 package functionality. Just drop l4 into a separate branch and I guess everyone's a winner. |
Your changes look good, thanks for taking the time to do that. I'll try to test & merge it as soon as I get a free weekend. |
No problem - Thanks for the package! I think the only area which might need changing, is the config file location in my fork is set as config/vendor/breadcrumbs.php, where as I think the tendency is that people are just putting the config file in the root config directory. (Which I'm not really a fan of) |
Released in 3.0.0 (along with a major internal refactoring, much better unit test coverage and brand new documentation). |
Sweeeet, thanks! 👌 |
breadcrumbs.php
my view
Error
The text was updated successfully, but these errors were encountered: