]> BookStack Code Mirror - bookstack/blob - app/Http/Controllers/Api/BooksApiController.php
Added API listing filtering & cleaned ApiAuthenticate returns
[bookstack] / app / Http / Controllers / Api / BooksApiController.php
1 <?php namespace BookStack\Http\Controllers\Api;
2
3 use BookStack\Entities\Book;
4
5 class BooksApiController extends ApiController
6 {
7     public $validation = [
8         'create' => [
9             // TODO
10         ],
11         'update' => [
12             // TODO
13         ],
14     ];
15
16     /**
17      * Get a listing of books visible to the user.
18      */
19     public function index()
20     {
21         $books = Book::visible();
22         return $this->apiListingResponse($books, [
23             'id', 'name', 'slug', 'description', 'created_at', 'updated_at', 'created_by', 'updated_by',
24             'restricted', 'image_id',
25         ]);
26     }
27
28     public function create()
29     {
30         // TODO -
31     }
32
33     public function read()
34     {
35         // TODO -
36     }
37
38     public function update()
39     {
40         // TODO -
41     }
42
43     public function delete()
44     {
45         // TODO -
46     }
47 }