if (!$order) {
abort(404);
}
Now you can do it in one line:
abort_if(!$order, 404);Isn't Laravel awesome? And there's also a direct opposite new function - abort_unless(). They were both introduced with a commit 18 days ago - here's how it looks internally:
Simple but nice, huh?