php - How to extend the MessageBag class in Laravel -



php - How to extend the MessageBag class in Laravel -

i need edit add method in laravel 4 messagebag class.

how can extend in laravel app , register utilize mymessagebag class instead of default messagebag class.

use illuminate\support\messagebag; class mymessagebag extends messagebag { public function add($key, $message) { if ($this->isunique($key, $message)) { $this->messages[$key] = $message; } homecoming $this; } }

have read this? http://laravel.com/docs/4.2/extending

anyway, think can extend laravel core classes next these steps:

create , register service provider add facade service provider, allow using static methods, , replace alias custom namespaced class

maybe answers question (with code): laravel extend form class

php laravel laravel-4

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -