laravel - Joining table created_at and updated_at values not being set -


i have 2 models, product , attribute. there 'product_attributes' joining table between 'products' , 'attributes'. relationship defined in both models using belongstomany(), , key of table compound 1 of product_id , attribute_id.

i can retrieve , store records in joining table - so, such functioning expected, exception created_at , updated_at in product_attributes not being set.

is above design, , there can rectify this?

you should use belongstomany function timestamps declaration this:

$this->belongstomany(<entity>)->withtimestamps(); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -