I'm doing a new plugin for OctoberCms. I would like to limit the front end registration for some specific domains.
I tried to this :
class Plugin extends PluginBase
{
[......]
public function boot()
{
// Listen for user creation
Event::listen('eloquent.creating: October\Rain\Auth\Models\User', function($model) {
{
$this->checkDomains($user);
[.....]
}
}
}
But my listener is not working. Do you know what is the Event, I should listen to catch before a new account is created ?
Thanks
You can bind to all of the model internal events like this:
User::extend(function($model) {
$model->bindEvent('model.beforeSave', function() use ($model) {
// do something
});
});
You can use before and after for create, update, save, fetch and delete
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With