I'm pretty sure you need to build and register your own Facade class to Notify::add()
like that.
Otherwise, you would need to type-hint a Container-resolved object (such as a controller) which will then use method injection to deliver an instance of your class:
// controller method
function doThing(NotifyHelper $notify)
{
$notify->add('make sense?');
}
PS you have your optional arguments the wrong way round in that example.
Thank you, that's what I needed. I ended up leaving MessageBag alone and creating my standalone class which will merge errors from Laravel, it seems Laravel only uses 'errors' anyway.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community