Support the ongoing development of →
Session IOC Validation
Last updated 2 years ago.

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.

Last updated 8 years ago.

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!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.