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 7466
This is my personal reference.
Mahmoudz 10 years ago 15368
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 13398
Add the attributes on the second parameter of the attach function.
Mahmoudz 10 years ago 15037
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 10 years ago 11327
adding default current timestamp.
Mahmoudz 10 years ago 32863
This is how to add a Foreign Keys in the Migration.
Mahmoudz 10 years ago 6666
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 10 years ago 6864
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 10 years ago 6850