Laravel Community Tools by Tighten

Popular tricks

458 tricks
GroupBy clause with multiple columns select in laravel
sanjok1988 5 years ago 20487
You can chain eager loading to avoid N+1 problem. Suppose you have 3 tables. customer[id, email], pos[id, serial_number] and restaurant[id, name, customer_id, pos_id] so restaurant table can act like a pivot table and it also have some value attribute. So now we can call customer from pos table via chaining eager loading.
milon 11 years ago 20324
What if instead of using debugging bar like https://github.com/barryvdh/laravel-debugbar or others, you could use something that integrates directly with Chrome's web developer tools? Imaging viewing request information, headers, get and post data, cookies, session data, DB queries, routes and timing, all within Chrome's developer tools panel? With this extension, you can! Read the instructions below to know how!
msurguy 12 years ago 20284
This is a simple trick that laravel run on IIS Server, this configuration will delete the public folder from the URL, but does not delete the public folder in the application. I was inspired by a trick-owned https://gist.github.com/leabdalla/6135627, but it can not load css, js, routing and other files. And I have experimented that overall laravel can run normally. this is my simple code, I put web.config in the root folder, and I did not change any of the main application, especially in public folders.
cyberid41 12 years ago 20166
4.1
The main difference is which side of the relationship holds the relationship's foreign key. The model that calls $this->belongsTo() is the owned model in one-to-one and many-to-one relationships and holds the key to the owning model.
sanjok1988 5 years ago 20176
Get results in a table when there are no results for the relationship
wallacemax... 10 years ago 20164
laravel globale search
hamdiantar 2 years ago 19953
You have election data in your database. Perhaps each candidate has 1 record, with his/her name and number of votes. The percentage of the vote that each candidate attained can be calculated per candidate, without having to loop through the data. Laravel's Collection class provides the `sum($column_name)` method, which sums the column totals. This can then be used to calculate the vote share. I've used PHP's `format_number` function to round up the final percentage. Extra points given for a bootstrap progress bar, to illustrate the vote share.
meigwilym 11 years ago 19848
Sometimes, you want to click a column to refine the results of a table further without going through the filter menu on a Filament table.
techenby 2 years ago 19430