S
S
student9852021-08-11 20:16:11
PHP
student985, 2021-08-11 20:16:11

How do interfaces make the trait's methods work?

In Laravel, you need to make imlements of the MustVerifyEmail interface and verification by email starts working. Can't figure out how it's done? Interface - regulates which methods need to be created or overridden in the class. But these methods are already in the class, regardless of the implementation of the interface. How does an interface change functionality?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lazy @BojackHorseman PHP, 2021-08-11
@student985

somewhere in the code there is a stupid check

if ($obj instanceof MustVerifyEmail) { 
    ... 
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question