diff -r 2b3247d02769 -r f55970e41793 server/src/app/Http/Controllers/Api/DocumentController.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/server/src/app/Http/Controllers/Api/DocumentController.php Mon Oct 05 17:02:10 2015 +0200 @@ -0,0 +1,99 @@ +documentRepository = $documentRepo; + } + + /** + * Display a listing of the resource. + * + * @return Response + */ + public function index() + { + return response()->json($this->documentRepository->paginateAll()); + } + + /** + * Show the form for creating a new resource. + * + * @return Response + */ + public function create() + { + // + } + + /** + * Store a newly created resource in storage. + * + * @param Request $request + * @return Response + */ + public function store(Request $request) + { + // + } + + /** + * Display the specified resource. + * + * @param int $id + * @return Response + */ + public function show($id) + { + $doc = $this->documentRepository->get($id); + if(is_null($doc)) { + abort(404); + } + return response()->json($doc); + } + + /** + * Show the form for editing the specified resource. + * + * @param int $id + * @return Response + */ + public function edit($id) + { + // + } + + /** + * Update the specified resource in storage. + * + * @param Request $request + * @param int $id + * @return Response + */ + public function update(Request $request, $id) + { + // + } + + /** + * Remove the specified resource from storage. + * + * @param int $id + * @return Response + */ + public function destroy($id) + { + // + } +}