Endpoint for single component
This commit is contained in:
@@ -6,4 +6,13 @@ class ApiController extends Dingo\Api\Routing\Controller{
|
||||
return Component::all();
|
||||
}
|
||||
|
||||
public function getComponent($id) {
|
||||
$component = Component::find($id);
|
||||
if ($component) {
|
||||
return $component;
|
||||
} else {
|
||||
App::abort(404, 'Component not found');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user