Eloquent ORM - Configurations

Various options that can be added inside framework model and other files
 

How to disable saving of eloquent timestamps

Basically timestamp saving means storing date data into created_at, modified_at or deleted_at fields in table of laravel database during resource...


Working with different table name for a model

If we need to work with a model with different table name which is usually needed for old projects where...


changing auto incremeneting field names

Like different table names it is also usually needed for old projects where incrementing field names for a table could...


Changing pagination setup mentioning item amount per page from model

By default it is setup to 15 in laravel but you can do that from model as well. You do...


Changing timestamp field names

Suppose there are timestamps fields created and modified in table then if we were to use that in project we...


Adding custom date fields for processing with Carbon object

Sometimes besides created_at and updated_at we may need another custom date fields which can be needed to process with Carbon...


Setting up custom date format

By default it is defined as 'Y-m-d H:i:s' and in order to use different date format we can use following...


Using fillable or guarded

If you have Post Model with title and description you can setup these fields with fillable or gurded in order...