mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-05 07:23:59 +08:00
a7a97a53f1
API listing endpoint filter can be found via &filter[name]=my+book query parameters. There are a range of operators that can be used such as &filter[id:gte]=4
47 lines
855 B
PHP
47 lines
855 B
PHP
<?php namespace BookStack\Http\Controllers\Api;
|
|
|
|
use BookStack\Entities\Book;
|
|
|
|
class BooksApiController extends ApiController
|
|
{
|
|
public $validation = [
|
|
'create' => [
|
|
// TODO
|
|
],
|
|
'update' => [
|
|
// TODO
|
|
],
|
|
];
|
|
|
|
/**
|
|
* Get a listing of books visible to the user.
|
|
*/
|
|
public function index()
|
|
{
|
|
$books = Book::visible();
|
|
return $this->apiListingResponse($books, [
|
|
'id', 'name', 'slug', 'description', 'created_at', 'updated_at', 'created_by', 'updated_by',
|
|
'restricted', 'image_id',
|
|
]);
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
// TODO -
|
|
}
|
|
|
|
public function read()
|
|
{
|
|
// TODO -
|
|
}
|
|
|
|
public function update()
|
|
{
|
|
// TODO -
|
|
}
|
|
|
|
public function delete()
|
|
{
|
|
// TODO -
|
|
}
|
|
} |