octobercms / october

Self-hosted CMS platform based on the Laravel PHP Framework.
https://octobercms.com/
Other
11.02k stars 2.21k forks source link

Error: "Mass assignment failed for model attribute" #1159

Closed daviskoko closed 9 years ago

daviskoko commented 9 years ago

Hi, I followed the back-end relations video by Samuel. I have a Model "Model1" which has many records in "Model2". But whenever i add fields in the field.yaml file of "Model2" i get this error "Mass assignment failed for model attribute"

scottbedard commented 9 years ago

This should solve your problem! http://laravel.com/docs/5.0/eloquent#mass-assignment

daftspunk commented 9 years ago

Yes, make sure the guarded property is empty.

The plugin itself is available for you to test:

https://github.com/daftspunk/oc-crm-plugin

daviskoko commented 9 years ago

Yeah. the laravel doc. was helpful

On Tue, May 26, 2015 at 8:07 AM, Samuel Georges notifications@github.com wrote:

Closed #1159 https://github.com/octobercms/october/issues/1159.

— Reply to this email directly or view it on GitHub https://github.com/octobercms/october/issues/1159#event-313476897.