What I want
Extend the Laravel class used by the seller, in particular: https://github.com/laracasts/flash and the class Flash/Message.php
.
Why i want
To add some class parameters for customization purposes,
What i tried
Everything I found on Google and viewing other questions.
I created my own service provider:
use Laracasts\Flash\FlashServiceProvider as BaseServiceProvider;
class FlashServiceProvider extends BaseServiceProvider
{
public function register()
{
$this->app->singleton( 'flash', function() {
return $this->app->make( 'App\Extensions\Laracasts\Flash\FlashNotifier' );
} );
}
}
And even managed to add a custom function to the class App\Extensions\Laracasts\Flash\FlashNotifier
.
Still not working
Despite the fact that I have successfully extended the class FlashNotifier
. I still have problems with it because it continues to use the original class Messages
instead of mine.
Question
FlashNotifier
Messages
, ?