{ Laravel snippets }

Jesse Schutt 💬

Jesse Schutt 💬 @jesseschutt

If your test is failing and you're pretty sure it shouldn't be, try adding "->fresh()" to the model under assertion. Chances are the assertion is failing due to creation properties such as "wasRecentlyCreated" on the original model. #laravelphp #testing https://t.co/8H8am3oxxW

Joseph Silber

Joseph Silber @joseph_silber

🔥 The "optional" helper in @laravelphp is great for safely calling a method on an object that could be null. But what if the method is not on the actual object itself? Well now you can pass in a closure to "optional", and it'll only call it if the given object is not null 💯 https://t.co/0RIbUffuOY

Stefan Bauer

Stefan Bauer @stefanbauerme

🔥 Don't forget you can make use of the faker library directly in your @laravelphp tests by just pulling in the "WithFaker" trait. Oh, and by the way. You can optionally pass a locale string to $this->faker() if you like. https://t.co/gaaNzjrFKY