vendredi 29 décembre 2017

How to insert a value to created_at field using Query Builder

I am new to Laravel. I am looking for a way to insert a value to specific field such as created_at automatically whenever the row is inserted to the DB table.

I found out that only Eloquent way which uses some Model->save() inserts timestamp to desired field.

But I want to be able to insert a value even when I use QueryBuilder. Is there any way to do so?

I have looked at this post: Query builder not inserting timestamps

Any advice would be appreciated.

Thank you in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire