Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have bug in fillable change diynamci #352

Open
vahidalvandi opened this issue May 18, 2020 · 4 comments
Open

have bug in fillable change diynamci #352

vahidalvandi opened this issue May 18, 2020 · 4 comments
Assignees

Comments

@vahidalvandi
Copy link

vahidalvandi commented May 18, 2020

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.

@mikebronner mikebronner self-assigned this May 19, 2020
@mikebronner
Copy link
Owner

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.

@vahidalvandi
Copy link
Author

vahidalvandi commented May 19, 2020 via email

@vahidalvandi
Copy link
Author

do it fixed?

@mikebronner
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants