MassAssignmentException Laravel Origin: Application & API Last updated 13 Oct 2026

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.

Exact message you may see Add [title] to fillable property to allow mass assignmentto fillable property
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

  1. Add the attribute to protected $fillable
  2. Pass only validated data ($request->validated())
  3. Use $model->field = value for one-off assignments

Detailed fix by platform

PHP

  1. php
    class Post extends Model
    {
        protected $fillable = ['title', 'body', 'user_id'];
    }
    Post::create($request->validated());

How to diagnose

  1. Model — $fillable/$guarded
  2. 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:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

ActiveModel::ForbiddenAttributesError (strong parameters) — Rails: ActiveModel::ForbiddenAttributesError (Ruby / Rails)ActiveModel::Forbidde…BadMethodCallException: Call to undefined method — Laravel: BadMethodCallException: Call to undefined method App\Models\Post::whereTitle() / Illuminate\Database\Eloquent\Builder::foo() (Laravel)BadMethodCallExceptio…No query results for model — Laravel: Illuminate\Database\Eloquent\ModelNotFoundException: No query results for model [App\Models\Post] 5 (Laravel)No query results for …Property [x] does not exist on this collection instance — Laravel: Exception: Property [name] does not exist on this collection instance. (Laravel)Property [x] does not…Route [login] not defined — Laravel: Symfony\Component\Routing\Exception\RouteNotFoundException: Route [login] not defined (Laravel)Route [login] not def…Target class does not exist — Laravel: Target class [App\Http\Controllers\X] does not exist. (PHP)Target class does not…The GET method is not supported for route — Laravel: The GET method is not supported for route x. Supported methods: POST (MethodNotAllowedHttpException) (Laravel)The GET method is not…MassAssig…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.