Laravel Community Tools by Tighten

Tag "events" tricks

15 tricks
Get a real-time view of all the currently executing queries.
mcraz 11 years ago 27363
logs a sql query with bindings replace by actual values
eugene_san... 12 years ago 9182
I have a legacy system that uses SHA1 for passwords as opposed to bcrypt, which is used by Laravel. For now, I need people to be able to access through both systems. I use the auth.attempt event to handle password conversion.
madshadow 12 years ago 14899
Forget cache upon model events or custom events
bwsewell 12 years ago 18367
If you're not making use of MySQL InnoDB cascades, you might still want to cause events (such as deleting) on related models to cascade. The example below listens for the deleted event on the Product model and cascades this to the child models.
robjmills 12 years ago 34856
It can sometimes be convenient to automatically validate your model when it gets created or updated. This is very easily achieved with Laravel through the use of Model events.
stidges 12 years ago 16370