Laravel Community Tools by Tighten

Popular tricks

458 tricks
with this trait you can get Enum values of a table /
nimahkh 8 years ago 13004
Check if the request matches the url. If so, add an active class to the menu item.
xtrasmal 12 years ago 12872
Reference the connection by name, the database could be named differently in another environment.\ Note: you might want to add backticks to the database name if the name uses alternative characters.
orlissenbe... 12 years ago 12900
Gulp is a javascript taskrunner (like Grunt) using Nodejs. You can use it to automatically run PHPUnit tests on saved files. Ex: Save Foo.php and run FooTest.php automatically. Link to gist: https://gist.github.com/varghesejacob/56e2637dcb5cd2bc4b51
residualfl... 12 years ago 12879
An example of how I did my filters.php and routes.php to populate many of the same structured routes. Used Sentry 2 for Authentication and short syntax for array() Suggestions to make it even DRYer are welcome. php artisan route output of the example http://paste.laravel.com/1cnE
XoneFobic 12 years ago 12804
Sometimes you would like to restrict a certain route parameter. For instance, if you are using route parameters to determine the ID of a certain model you are using, you would only like digits to be passed, not alphabetical characters. You can set these restrictions on the route using ->where('<pattern>'). But what if you have a huge list of routes that all use the same pattern restriction? That's where this will come in handy.
stidges 12 years ago 12597
If you want your search functionality to be dynamic as possible to avoid code repetitions, you can use this trait directly in your models
kissartisa... 8 years ago 12582
If you want to count the number of results from a relationship without actually loading them you may use the "withCount" method, which will place a "{relation}_count" column on your resulting models.
kupendra 7 years ago 12541
Laravel OTP is a comprehensive package that simplifies the generation and verification of Time-based One-Time Passwords (TOTP) and HMAC-based One-Time Passwords (HOTP). Whether you're building two-factor authentication or securing API access, Laravel OTP offers an easy-to-use, Google Authenticator-compatible solution. With support for TOTP and HOTP, and built-in methods for secret generation and verification, this package is perfect for adding an additional layer of security to your Laravel applications.
mustafakha... 2 years ago 12565