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 7575
This is my personal reference.
Mahmoudz 11 years ago 15547
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 13559
Add the attributes on the second parameter of the attach function.
Mahmoudz 11 years ago 15210
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 11 years ago 11504
adding default current timestamp.
Mahmoudz 11 years ago 33057
This is how to add a Foreign Keys in the Migration.
Mahmoudz 11 years ago 6770
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 7043
Model Based Setting Different Connection when working with 2 or more database in laravel
dhrubo001 11 years ago 7034