What are the Must Known Laravel Model Conventions? | Laravel Models 101: for Beginners #laravel
In this tutorial, we explore essential Laravel model conventions that every Laravel developer should know. We cover key concepts such as:
- Timestamps and how to customize them
- The $dateFormat property for specifying date formats
- Customizing column names for created_at and updated_at
- Setting default attribute values
- Using the $connection property to work with multiple databases
By mastering these conventions, you’ll be able to work more efficiently with Eloquent models and leverage Laravel’s powerful ORM features to their fullest potential. Whether you’re a beginner or an experienced developer, this tutorial will help you write cleaner, more maintainable code in your Laravel applications.
🧑🏼💻 Need a Laravel agency?
Do you need assistance with your next project in Laravel? Contact my Laravel agency for help:
🔥 Resources
- Twitter:
- Instagram:
- Blog:
- GitHub:
- TikTok: @codewithdary
⌛Timestamps
00:00 - Introduction
01:25 - Changing table names
03:10 - Changing the primary key
04:58 - Incrementing property
06:31- Changing the key type of the primary key
07:31- Disabling the updated_at and created_at
09:22 - Customizing the format of your models timestamps
10:12- Customize the names of the timestamps columns
10:46 - Set default attribute values
12:50 - Change the database interacting with a particular model
#laravel #codewithdary #laravel #php #coding
1 view
75
18
1 week ago 00:00:39 1
[Kids Poem] Introducing My Family | World Mission Society Church of God
2 weeks ago 00:08:37 2
A pool tour with beautiful girls! Turkey Alanya 2024
2 weeks ago 01:19:01 1
Dr. Anna Lembke: Understanding Addiction and the Role of Faith in Recovery (FULL INTERVIEW)
2 weeks ago 00:42:31 3
Secret Door Bookcase made from Pallet Wood and Scrap
2 weeks ago 00:00:19 1
They are so connected, they know exactly what they’re doing😅 #theuntamed #xiaozhan #wangyibo #fyp
3 weeks ago 00:03:57 107
Earthquake NOW In USA! California SHAKEN TODAY! Los angeles Earthquake March 9 2025
3 weeks ago 00:11:37 1
Neuromarketing: How brands are getting your brain to buy more stuff
4 weeks ago 00:00:20 227
250302 LISA (BLACKPINK) @ Red Carpet Oscars 2025 GLAMBOT
4 weeks ago 00:09:03 2
Moments of people on vacation and more! - Turkey Alanya 2024
4 weeks ago 00:02:56 1
Oh Wonder - Technicolour Beat - 10 Years On (Official Audio)