Laravel Community Tools by Tighten

Popular tricks

458 tricks
The following example shows an controller with a method, in which we change some values from the .env. Make sure, the entries you want to change, really exist in your .env. https://github.com/Brotzka/laravel-dotenv-editor
ramesh 9 years ago 9125
5.0
This code snippet overrides DuskTestCase->createBrowsers method to allow HTML elements count assertion
nezarfadle 9 years ago 9127
It's possible to add condition to your model's relationships... Help me to use Eloquent with a legacy database..
Matt 12 years ago 9069
For example, if you are using a caching server which listens on HTTPS, which retrieves your content from another (local server) which isn't using HTTPS, your links might be generated as http://mysite.com instead of the desired https://mysite.com. With this trick you can circumvent this.
berendiwem... 12 years ago 9085
Sometimes you need to use some packages based on the environment in which the application is running in, for example "development". You can append environment service providers and aliases in your development configuration file "app/config/development/app.php" with the "append_config" helper method.
hosmelq 12 years ago 9049
4.1
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 9056
5.4
Let's say that your validation is conditional on multiple rules.... This is a bit tricky because it's not obvious how to get the other rules passed to the validator. Here's how you'd do it
sgelbart 10 years ago 9054
4.0
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 9033
Laravel Load More Data on Page Scroll – Laravel 5
dave 8 years ago 9035