Laravel Community Tools by Tighten

Popular tricks

458 tricks
I was looking for a way to remove one of my middlewares in testing. I could not find it, so I wrote a simple function to do it. Put the following function in your 'TestCase.php'
moon0326 11 years ago 9539
Laravel Load More Data on Page Scroll – Laravel 5
dave 9 years ago 9494
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 10 years ago 9490
5.0
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 9445
4.1
This code snippet overrides DuskTestCase->createBrowsers method to allow HTML elements count assertion
nezarfadle 9 years ago 9487
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 11 years ago 9456
4.0
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 9442
It's possible to add condition to your model's relationships... Help me to use Eloquent with a legacy database..
Matt 12 years ago 9416
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... 11 years ago 9422