wintercms / wintercms/wn-user-plugin
Redefinition of variable parameters
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 13
- Forks
- 20
- Avg merge
- 50m
- Merged PRs (30d)
- 1
Description
Hello! In my plugin I'm using this code, to redefinition of variable parameters. On OctoberCMS it's working
public function boot(){
\RainLab\User\Models\User::extend(function($model) {
$model->bindEvent('model.beforeValidate', function() use ($model) {
$model->rules['email'] = 'required|between:55,60|email|unique:users';
});
});
}
On Winter.User when I replace \RainLab\User\Models\User to \Winter\User\Models\User it doesn`t work. Why?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the plugin's boot() method and inspect the model.beforeValidate binding on Winter\User\Models\User, including the email rule assignment. Compare that extension point with the OctoberCMS example and verify the behavior against the Winter User model. Done means identifying why the replacement no longer works and documenting the applicable model-extension path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100