Self-contained condition expression

This commit is contained in:
James Brooks
2014-11-24 20:53:00 +00:00
parent 565380fc5c
commit a2c65d0e03

View File

@@ -7,8 +7,7 @@
}
public function getComponent($id) {
$component = Component::find($id);
if ($component) {
if ($component = Component::find($id)) {
return $component;
} else {
App::abort(404, 'Component not found');