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
67
17
7 months ago 01:00:19 1
Agents of SHIELD S1E17 - Turn, Turn, Turn with Clark Gregg
7 months ago 00:03:41 1
Max Oazo & Ojax - Itโs My Life Remix | Best Deep House Remix 2024