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

Do not allow $fillable usage (use $guarded instead) #700

Closed
mantas-done opened this issue Nov 12, 2024 · 1 comment
Closed

Do not allow $fillable usage (use $guarded instead) #700

mantas-done opened this issue Nov 12, 2024 · 1 comment

Comments

@mantas-done
Copy link

Q A
Bug report? no
Feature request? yes
Library version x.y.z

New rule request. Do not allow $fillable usage (use $guarded instead).

@achrafAa
Copy link

Best Practices:

  • Use $fillable when you have a small number of attributes that need to be mass-assigned. It’s more secure because it explicitly defines what can be assigned.

  • Use $guarded when you have many attributes and only a few need to be restricted. It’s more convenient but less explicit.

  • Avoid using $guarded = [] (allowing all attributes) unless you fully trust the input data, as it can lead to security vulnerabilities.

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

No branches or pull requests

2 participants