Laravel: Illuminate\Database\Eloquent\MassAssignmentException: Add [x] to fillable property to allow mass assignment
You passed an array to create()/update()/fill() containing a field that isn’t in the model’s $fillable list.
Seen on:
Laravel
Meaning
Laravel protects models from mass assignment of unexpected fields. Add the field to $fillable (recommended) or use $guarded deliberately — never unguard everything for request data.
Common causes
- Field not listed in $fillable
- Using $request->all() with extra fields
- Model uses $guarded = ['*'] (default)
⚡ Quick fix
- Add the attribute to protected $fillable
- Pass only validated data ($request->validated())
- Use $model->field = value for one-off assignments
Detailed fix by platform
PHP
- php
class Post extends Model { protected $fillable = ['title', 'body', 'user_id']; } Post::create($request->validated());
How to diagnose
- Model — $fillable/$guarded
- Input — Which field is named?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Route [login] not defined Laravel: Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined
- Target class does not exist Laravel: Target class [App\Http\Controllers\X] does not exist.
- The GET method is not supported for route Laravel: The GET method is not supported for route x. Supported methods: POST (MethodNotAllowedHttpException)
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026