I use the same but haven't seen this error before (I use strict mode and the package). Can you see what exact code is causing the error ?
Strict Mode issue with fillable and (non)related models?
Has anyone else come across this?
Basically i'm trying out Strict Mode (love it!), and whilst re-running my tests after enabling, i'm getting failures due to MassAssignmentExceptions. These failures are asking me to:
Add fillable property [roles] to allow mass assignment on [App\Models\User].
Now i'm using Spatie Permissions for role management, so there is no roles attribute in the User Model/Table, so it shouldn't be in there (and it blows if you add it). So i'm a bit confused as to the advice being given by the exception/test.
Have other occurrences of the same issue, where the test is telling me to add attributes to fillable that don't exist on the model in question.
@npw Do you use the validated data directly then? Cause that would indeed cause that error :)
User::create($request->validated());
Please or to participate in this conversation.