Files
cachet-docker/app/controllers/ApiController.php
2014-11-25 08:57:25 +00:00

18 lines
311 B
PHP

<?php
class ApiController extends \Dingo\Api\Routing\Controller{
public function getComponents() {
return Component::all();
}
public function getComponent($id) {
if ($component = Component::find($id)) {
return $component;
} else {
App::abort(404, 'Component not found');
}
}
}