Laravel Community Tools by Tighten

Category "Performance" tricks

29 tricks
Some functions, that help u get readable number. For example: 5145=>5,1K 3465645=>3,4M 4544353454=>4.5B 345,45=>345
andrii-chy... 8 years ago 4312
This is a simple solution to create ACL using middleware and role ID. Please follow step by step as shown below. <br> <br>1) create column group_id (int) at users table. <br> <br>2) give value on that column | group_id values: | 1 = Admin | 2 = HR | 3 = Staff 3) create new middleware using php artisan php artisan make:middleware Role 4) Edit the middleware file 5) Edit kernel file and put another line for role class. 6) Set the route and put the role id which allow it to access
laraveltri... 8 years ago 7138
5.0
View composers are nice but they have some problems accocsiated with them. 1- you never know where the data is coming from when you look at your html 2- They offer no easy way of caching the result. You can use the "widget pattern" to have much better performance and structure in your apps + many more bonuses ! :)
imanghafoo... 8 years ago 6407
Automatically deleting related rows in Laravel (Eloquent ORM)
dickyeka 9 years ago 30415
The primary reason why SSL is used is to keep sensitive information sent across the Internet encrypted so that only the intended recipient can understand it. As a web developer one should always provide the SSL for their clients so that they can share their critical information, freely trusting the encryption. This is important because the information you send on the internet is passed from computer to computer to get to the destination server.
jamilaliah... 9 years ago 9193
5.0
I made a filter for Laravel 5.0 , you can redirect non-www URLs to www URL and you don't need to write any difficult htaccess codes . Just put the filter in routes.php and use it for any Routes you want them to be with WWW . This snipped code is made by www.larabook.ir
hpakdaman 10 years ago 16603
This Trait helps you to pass "variables" anywhere in controllers to "view" . you can use "$this->view->..." in controller to pass your variables , also you can use "$this->view()" same as "view()" helper with same functionality to render the view . ( this package is made by larabook.ir)
hpakdaman 10 years ago 14666
if you need to make a single ton class and you need to access that in your whole application do that in laravel 5
wasiqaftab 10 years ago 7541
There are many tricks to return the response in `json`. Actually, if the returned value is an array or instance of "arrayableinterface" or "jsonableinterface" such as eloquent model, you could just return it, it'll be a json, magically. There are following three way i have noticed performance :) Thanks. #KeepSharing
pratikbuta... 10 years ago 8971