Self-contained condition expression
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user