Laravel Community Tools by Tighten

Category "Eloquent" tricks

140 tricks
inside the testing folder add a database.php film with the following configuration:
Mahmoudz 11 years ago 7704
This is my personal reference.
Mahmoudz 11 years ago 15703
This sample covers the following scenario: Every course has may chapters, while a chapter can belong to only one course. In the other hand every chapter has many videos while a video can belong to many chapters. I will write the description below.
Mahmoudz 11 years ago 13700
Add the attributes on the second parameter of the attach function.
Mahmoudz 11 years ago 15361
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 11 years ago 11677
adding default current timestamp.
Mahmoudz 11 years ago 33212
This is how to add a Foreign Keys in the Migration.
Mahmoudz 11 years ago 6910
This trait allows you to save any column from any model into a location within the storage directory to allow the column to be blade compilable with view()->file($model->getViewableColumnPath('column_name')); The trait
leemason 11 years ago 7170
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 11 years ago 7200