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 7627
This is my personal reference.
Mahmoudz 11 years ago 15625
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 13625
Add the attributes on the second parameter of the attach function.
Mahmoudz 11 years ago 15283
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 11 years ago 11582
adding default current timestamp.
Mahmoudz 11 years ago 33134
This is how to add a Foreign Keys in the Migration.
Mahmoudz 11 years ago 6829
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 7094
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 11 years ago 7119