Laravel Community Tools by Tighten

Popular tricks

458 tricks
Using laravel eloquent, you have an amazing feature called `Accessors`, which allows you to define a non-existing column, here's an example to get user full_name that does not exist in the users table
thefeqy 5 years ago 15829
This is my personal reference.
Mahmoudz 10 years ago 15388
With this trick you will able to unitTest complex query, that will have closures.
fenos 11 years ago 15308
You can filter by NULL in Eloquent, but if you're filtering the collection further - filter by empty string, there's no "null" in that field anymore.
fatihtopra... 5 years ago 15264
Laravel package to let you manage de-normalized tables with simple configurations. Just add array based config in your models and it will automatically sync your denormalized tables. https://github.com/tkeer/flattable
tkeer 5 years ago 15222
If you want to use Sentry 2 filters used in Laravel 4.x, you have to modify your system a little bit. <br/> First install Sentry 2 for Laravel 5: "composer require cartalyst/sentry:dev-feature/laravel-5" Next add these three files to your App\Http\Middleware folder, then add the references into the Kernel.php file. Finally, I added an example route how to use the Middlewares. An advice: in your controller replace all catch() lines from: catch (Cartalyst\Sentry\Users\LoginRequiredException $e) {} to: catch (\Cartalyst\Sentry\Users\LoginRequiredException $e) {} because it won't work as in Laravel 4.x worked..
subdesign 11 years ago 15147
5.0
How to update many-to-many relationship
nihaoit 11 years ago 15099
Separate routes for large applications into multiple smaller route partial files that are automatically loaded at runtime. Example 'app/routes.php' file.
jhauraw 11 years ago 15015
Add the attributes on the second parameter of the attach function.
Mahmoudz 10 years ago 15053