S
S
sawa42016-09-08 09:50:57
Laravel
sawa4, 2016-09-08 09:50:57

How to override a class in Laravel?

Hi guys!
Actually the question is
: If I need to change a class in yii, I create it in frontend/components/MyClassName; my class and change the kernel class

namespace frontend\components;
use yii\somefolder\ClassName;
class MyClassName extends ClassName
{
 //делаю что хочу и как хочу
}

How to do the same in Laravel 5.2 ?
I need to get link from sendResetLink method or this emailResetLink method when resetting password

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2016-09-08
Protko @Fesor

you don't have to. Open close principle. Everything can be solved without "redefinitions", it's just such nonsense in yii.

K
Kirill Nesmeyanov, 2016-09-08
@SerafimArts

To do this, you just need to replace the implementation in the container following the interface of the component. DI, Carl =)

V
Vyacheslav Plisko, 2016-09-08
@AmdY

Here is an example of how to spoof PasswordBroker stackoverflow.com/questions/34409236/how-to-send-t...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question