-
Notifications
You must be signed in to change notification settings - Fork 232
have bug in fillable change diynamci #486
-
Describe the bug
i need chnage fillable in eloquent by user role
public function __construct(array $attributes = []) {
if(auth()->user()->is_admin){
$this->fillable[] = 'is_active';
$this->fillable[] = 'sales_discount';
$this->fillable[] = 'business_package_id';
$this->fillable[] = 'business_contract_id';
}
parent::__construct($attributes);
}
but need twice update for get fillable
Environment
- PHP: 7.4
- OS: Ubuntu 18.04
- Laravel: 6.18
- Model Caching: 0.7.4
Additional context
Add any other context about the problem here.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 4 comments
-
Hi @vahidalvandi, Thanks for reporting this. My hunch says this issue is not related to the package. I will try to recreate this in a test case. If you are able to recreate this in a unit test, please submit a PR for it, that would help a lot.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.
All reactions
-
do it fixed?
Beta Was this translation helpful? Give feedback.
All reactions
-
@vahidalvandi Can you provide the eloquent query you are having problems with as well?
Beta Was this translation helpful? Give feedback.