Laravel Community Tools by Tighten

Barna Szalai

Joined: 11 years ago
Total tricks: 4
Last trick: 8 years ago

Submitted tricks

In this example I use Monolog for logging user activity in my cms admin. Usage: add the following line to the controller's constructor: UserLog::write();
subdesign 11 years ago 33671
4.2
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 10 years ago 15081
5.0
If you know what nested sets are, and use lazychazer/laravel-nestedset package, and tried his example application (https://github.com/lazychaser/nestedset-app), then here is a snippet for replace his simple nav rendering to bootstrap (3.x) navbar compatible output. (Laravel 5 solution)
subdesign 10 years ago 11951
5.0
If you have a dynamically generated list from DB, like [1 => 'First option', 2 => 'Second option', ...] use the following Collection magic to build a full select list with 'Please choose..' option at the beginning and 'Other..' option at the end.
subdesign 8 years ago 4520