-
Hello, Permission::firstOrCreate(['name' => 'create user']);
$admin = Role::firstOrCreate(['name' => 'admin']);
$admin->syncPermissions('create user'); This works OK in code (which is why I haven't filed it as a bug) but when evaluating through PHPStorm, I get these warnings:
This issue is present with my own models as well, solved through mixing in the Eloquent Builder docs with my class phpdoc: use Illuminate\Database\Eloquent\Builder;
/**
* Class User
*
* @package App\Models
* @mixin Builder
*/ The question now is, do I have a way of solving this for my Role and Permission models without having to re-implement many of the features that are provided in the default model? and are there any issues with adding that mixin in the default models? I would create the pull request if that's allowed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm sorry for asking for a direct review, but since it has been a week, @drbyte could you perhaps give me an insight on your policy for this? Cloning the repository, I realized there isn't a phpdoc block in the file at all. Considering this, should I work on this issue and create a pull request on it? |
Beta Was this translation helpful? Give feedback.
-
Extending the model and adding the docblock and mixin notation to it will also work, without having to re-implement the class. |
Beta Was this translation helpful? Give feedback.
Extending the model and adding the docblock and mixin notation to it will also work, without having to re-implement the class.