Laravel Community Tools by Tighten

Category "Eloquent" tricks

140 tricks
inside the testing folder add a database.php film with the following configuration:
Mahmoudz 10 years ago 7524
This is my personal reference.
Mahmoudz 10 years ago 15478
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 10 years ago 13487
Add the attributes on the second parameter of the attach function.
Mahmoudz 10 years ago 15141
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 10 years ago 11425
adding default current timestamp.
Mahmoudz 10 years ago 32958
This is how to add a Foreign Keys in the Migration.
Mahmoudz 10 years ago 6716
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 6968
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 11 years ago 6965