Laravel Community Tools by Tighten

Recent tricks

458 tricks
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 6 years ago 12117
Sometimes you may wish to eager load a relationship, but also specify additional query constraints for the eager loading query. Here's an example:
BenaliDjam... 6 years ago 9694
There are not any option to disable view cache in Laravel but in windows you can use following .bat file out of box and in other OS's you can do something similar...
tuytoosh 6 years ago 11934
using same form request for create and update
hardevine 7 years ago 11811
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... 7 years ago 11981
If You're raning Laravel 5.4, You May Get An Error While You'are Migrate Or Dealing with the db . The Error is look like : [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email)) [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
AdeLDev 7 years ago 9100
5.4
If your need usage DataTable with default configurations for many pages, do you can create your 'setter' for default table elements.
sr2ds 7 years ago 9803
If your need run TDD on SQLite (this perfect performance if run on memory) and your migrations have most alter tables, probably you have a problems.
sr2ds 7 years ago 8132
One file for all routes is bad idea. For simplify this, look this snippets.
sr2ds 7 years ago 7610
4.2