Vallavan J
Vallavan J

Reputation: 49

How to override something from vendor laravel 5

I want to override

 vendor\laravel\framework\src\Illuminate\Auth\Password\DatabaseTokenRepository.php

I tried this user model in app folder.. but that is not working.. Can you tell me where to put it?

Upvotes: 0

Views: 811

Answers (1)

Imran
Imran

Reputation: 4750

So see this is a vendor class. If you want to override any functionality of that class you can do so by applying method overriding. Just extends the class that you wan't to override, then redefine the function that you want to override in your class. Now, you can use your own class whenever need instead of the vendor class.

For example:

class TokenRepo extends DatabaseTokenRepository{
    //Define the functionality here to ovrride
}

Usages:

$token = new TokenRepo();//instead of original DatabaseTokenRepository

Upvotes: 1

Related Questions