PHP Class BookStack\Http\Controllers\BookController

Inheritance: extends Controller
Show file Open project: ssddanbrown/bookstack

Protected Properties

Property Type Description
$bookRepo
$chapterRepo
$pageRepo
$userRepo

Public Methods

Method Description
__construct ( BookRepo $bookRepo, PageRepo $pageRepo, ChapterRepo $chapterRepo, UserRepo $userRepo ) BookController constructor.
create ( ) : Response Show the form for creating a new book.
destroy ( $bookSlug ) : Response Remove the specified book from storage.
edit ( $slug ) : Response Show the form for editing the specified book.
getSortItem ( $bookSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Shows the sort box for a single book.
index ( ) : Response Display a listing of the book.
restrict ( $bookSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector Set the restrictions for this book.
saveSort ( string $bookSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector Saves an array of sort mapping to pages and chapters.
show ( $slug ) : Response Display the specified book.
showDelete ( $bookSlug ) : Illuminate\View\View Shows the page to confirm deletion
showRestrict ( $bookSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View Show the Restrictions view.
sort ( string $bookSlug ) : Illuminate\View\View Shows the view which allows pages to be re-ordered and sorted.
store ( Illuminate\Http\Request $request ) : Response Store a newly created book in storage.
update ( Illuminate\Http\Request $request, $slug ) : Response Update the specified book in storage.

Method Details

__construct() public method

BookController constructor.
public __construct ( BookRepo $bookRepo, PageRepo $pageRepo, ChapterRepo $chapterRepo, UserRepo $userRepo )
$bookRepo BookStack\Repos\BookRepo
$pageRepo BookStack\Repos\PageRepo
$chapterRepo BookStack\Repos\ChapterRepo
$userRepo BookStack\Repos\UserRepo

create() public method

Show the form for creating a new book.
public create ( ) : Response
return Response

destroy() public method

Remove the specified book from storage.
public destroy ( $bookSlug ) : Response
$bookSlug
return Response

edit() public method

Show the form for editing the specified book.
public edit ( $slug ) : Response
$slug
return Response

getSortItem() public method

Used via AJAX when loading in extra books to a sort.
public getSortItem ( $bookSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
$bookSlug
return Illuminate\Contracts\View\Factory | Illuminate\View\View

index() public method

Display a listing of the book.
public index ( ) : Response
return Response

restrict() public method

Set the restrictions for this book.
public restrict ( $bookSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector
$bookSlug
$request Illuminate\Http\Request
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

saveSort() public method

Saves an array of sort mapping to pages and chapters.
public saveSort ( string $bookSlug, Illuminate\Http\Request $request ) : Illuminate\Http\RedirectResponse | Redirector
$bookSlug string
$request Illuminate\Http\Request
return Illuminate\Http\RedirectResponse | Illuminate\Routing\Redirector

show() public method

Display the specified book.
public show ( $slug ) : Response
$slug
return Response

showDelete() public method

Shows the page to confirm deletion
public showDelete ( $bookSlug ) : Illuminate\View\View
$bookSlug
return Illuminate\View\View

showRestrict() public method

Show the Restrictions view.
public showRestrict ( $bookSlug ) : Illuminate\Contracts\View\Factory | Illuminate\View\View
$bookSlug
return Illuminate\Contracts\View\Factory | Illuminate\View\View

sort() public method

Shows the view which allows pages to be re-ordered and sorted.
public sort ( string $bookSlug ) : Illuminate\View\View
$bookSlug string
return Illuminate\View\View

store() public method

Store a newly created book in storage.
public store ( Illuminate\Http\Request $request ) : Response
$request Illuminate\Http\Request
return Response

update() public method

Update the specified book in storage.
public update ( Illuminate\Http\Request $request, $slug ) : Response
$request Illuminate\Http\Request
$slug
return Response

Property Details

$bookRepo protected property

protected $bookRepo

$chapterRepo protected property

protected $chapterRepo

$pageRepo protected property

protected $pageRepo

$userRepo protected property

protected $userRepo