Home / Snippets / How to Disable Timestamp in Laravel
How to Disable Timestamp in Laravel cover

How to Disable Timestamp in Laravel

469

3 years ago

0 comments

To disable the timestamp of your Laravel model you can specify the "$timestamps" value to "false". By doing so it will let Laravel know that the timestamp is not necessary for the Eloquent instance.

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Post extends Model
{
    public $timestamps = false; # disable created_at and updated_at
}
notion avatar

Alaz

Week-end developer currently experimenting with web, mobile, and all things programming.

Topics:

Frontend

Resource

Average

Average

Support Us

If you like our tutorial, support us by being our Patreon or buy us some coffee ☕️

Welcome to PostSrc V3

PostSrc Dark Logo

You have to login to favorite this