What if you’re working with a non-Laravel database and your timestamp columns are named differently than default created_at and updated_at? Maybe, you have create_time and update_time. Luckily, you can specify them in the Model, too:
class Role extends Model{ const CREATED_AT = 'create_time'; const UPDATED_AT = 'update_time';}
Enjoyed This Tip?
Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.
Recent Courses
Queues in Laravel 13
18 lessons
1 h 12 min read
[FREE] Laravel 13 for Beginners: 3 Demo Projects
5 lessons
29 min
[NEW] NativePHP v3: Create Mobile Apps with Laravel
9 lessons
53 min