Hi,
I have a custom controller and form to list/manage backend users.
I extended the backend user model to MyUser model and I can list all users and see user details.
The problem is that I can't have my overridden version of base models being invoked, only the parent version of the methods are being called.
Here is my model:
<?php namespace My\Models;
use Model;
use Backend\Models\User as BackendUserModel;
/**
* MyUser Model
*/
class MyUser extends BackendUserModel
{
public function __construct(array $attributes = array())
{
parent::__construct($attributes);
}
public function beforeCreate()
{
dd("this beforeCreate not being called, parent beforeCreate is being called instead");
//...
}
public function getGroupsOptions()
{
dd("this getGroupsOptions not being called, parent getGroupsOptions is being called instead");
//...
}
}
What is wrong here? What do I need to do in order to have my beforeCreate and getGroupsOptions methods to override the parent methods?