While programming my Authentication app on Laravel, I came across to an error I\'ve never seen before. I\'ve been brainstorming for almost an hour for the cause of this problem
I'm not a pro at implementing PHP Interfaces, but I believe you need to include all methods of UserInterface
and RemindableInterface
in your User
class (since it implements them). Otherwise, the class is "abstract" and must be defined as such.
By my knowledge, a PHP interface is a set of guidelines that a class must follow. For instance, you can have a general interface for a specific database table. It would include definition of methods like getRow()
, insertRow()
, deleteRow()
, updateColumn()
, etc. Then you can use this interface to make multiple different classes for different database types (MySQL, PostgreSQL, Redis), but they must all follow the rules of the interface. This makes migration easier, since you know no matter which database driver you are using to retrieve data from a table it will always implement the same methods defined in your interface (in other words, abstracting the database-specific logic from the class).
3 possible fixes, as far as I know:
abstract class User extends Eloquent implements UserInterface, RemindableInterface
{
}
class User extends Eloquent
{
}
class User extends Eloquent implements UserInterface, RemindableInterface
{
// include all methods from UserInterFace and RemindableInterface
}
I think #2 is best for you, since if your class doesn't implement all methods from UserInterface
and RemindableInterface
why would you need to say it does.