Skip to content

have bug in fillable change diynamci #352

@vahidalvandi

Description

@vahidalvandi

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions