Laravel Community Tools by Tighten

Popular tricks

458 tricks
Laravel's docs suggest to override the Model's getDates() methods when adding your own date fields. http://laravel.com/docs/4.2/eloquent#date-mutators To keep the default created_at, updated_at and deleted_at date fields, these must also be returned by the method, giving you at least 4 elements to the array. An easier (or at least, tidier) way is to set the protected $dates property with your own fields. These are merged with the defaults.
meigwilym 11 years ago 11349
cannot end a section without first starting one in new Laravel 5.3
shahmir811 9 years ago 11375
in this example there is a one to many relation. [course has many chapters]
Mahmoudz 10 years ago 11342
It's easy to notify one user by mail. But how to send a mail to all members of a Team? You can send one email to multiple recipients but it's not convenient, as it discloses recipient emails, which is not secure. Thus, you need to send bunch of personal emails on a loop. To do this create new TeamMailChannel and get MailChannel inside of it. Then iterate over users of a group and send emails. Your notification class should include TeamMailChannel inside via, however you should still use `toMail` method to prepare a message.
DavertMik 7 years ago 11249
5.6
This snippet can be used to view a linked list to all your available views, useful for reviewing different screens.
mohamed 12 years ago 11146
Hi ! Write your templates, controllers, ... without boring with translations. When you have finished to code, just execute the following command. It will generate and synchronise all needed files in your `lang/*/` directories. The package is available here : https://github.com/potsky/laravel-localization-helpers
potsky 11 years ago 11127
When saving/updating a model you might want to get a JSON response that includes some relationship data as well.
m4nuC 12 years ago 11162
Its Diffucult to convert whole object to an array . Normally we are Doing it By Iterate through foreach. By using Below Code we will reduce amount of line of code
kmlnyk 9 years ago 11086
When creating JS heavy apps some times you need to simulate a network delay so you can see how things are working as it's loading. This simple trick will do just that.
ericlbarne... 12 years ago 11004