in Resources

Quick Tip To Speed Up Your Laravel Tests

Here is a quick tip that will speed up your Laravel unit tests straight from Taylor Otwell (the creator of Laravel).

Update your CreatesApplication trait to include this Hash::setRounds call and then compare the speed difference in running your tests. ?

— Taylor Otwell ?‍♂️ (@taylorotwell) December 19, 2017

For this change you just need to edit the `CreatesApplication` trait and add the function `Hash::setRounds(4);` into the createApplication method. The setting will change the work factor of the bcrypt hasher. Many people are seeing speed changes of up to 50% so it's worth trying out.

Upgrade to access all content on Paulund

Members unlock all tutorials and snippets

Access to all downloadable content

Access to code examples before others

Sign Up Now

Already a member? Login here

Subscribe To The Weekly Newsletter

Get weekly updates to your email