Scroll to top

Updated_at and created_at are empty or zeros

If you use DB class and thinking that it will fill updated_at and created_at then you are wrong it wont . It will only fill updated_at and created_at if you use Eloquent models . So next time make sure to instantiate Eloquent model if you need timestamp columns

$post = new Post();
$post->name=Str::slug("this will fill timestamps columns");
Author avatar

Imran is a web developer and consultant from India. He is the founder of KodeInfo, the PHP and Laravel Community . In the meantime he follows other projects, works as a freelance backend consultant for PHP applications and studies IT Engineering . He loves to learn new things, not only about PHP or development but everything.

Post a Comment

Your email address will not be published. Required fields are marked *