Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

have bug in fillable change diynamci #486

vahidalvandi started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 4 comments

Comment options

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.

You must be logged in to vote
0 replies
Comment options

Thank you . This bug related with this package because after remove cache trait fix it
...
On 2020年5月19日, 18:57 Mike Bronner, ***@***.***> wrote: Hi @vahidalvandi <https://github.com/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. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#352 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4BZB3C3IWQNUGTH67JIHLRSKJN5ANCNFSM4ND4ZQKA> .
You must be logged in to vote
0 replies
Comment options

do it fixed?

You must be logged in to vote
0 replies
Comment options

@vahidalvandi Can you provide the eloquent query you are having problems with as well?

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Converted from issue

This discussion was converted from issue #352 on March 05, 2025 13:45.

AltStyle によって変換されたページ (->オリジナル) /