1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Standardised how request is injected into controller methods

Puts it in-line with how Laravel recommend.
This commit is contained in:
Dan Brown
2019-09-15 18:53:30 +01:00
parent be08dc1588
commit 3281925375
10 changed files with 59 additions and 50 deletions

View File

@ -574,13 +574,14 @@ class PageController extends Controller
/**
* Does the action of moving the location of a page
* @param Request $request
* @param string $bookSlug
* @param string $pageSlug
* @param Request $request
* @return mixed
* @throws NotFoundException
* @throws \Throwable
*/
public function move($bookSlug, $pageSlug, Request $request)
public function move(Request $request, string $bookSlug, string $pageSlug)
{
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
$this->checkOwnablePermission('page-update', $page);
@ -632,13 +633,14 @@ class PageController extends Controller
/**
* Create a copy of a page within the requested target destination.
* @param Request $request
* @param string $bookSlug
* @param string $pageSlug
* @param Request $request
* @return mixed
* @throws NotFoundException
* @throws \Throwable
*/
public function copy($bookSlug, $pageSlug, Request $request)
public function copy(Request $request, string $bookSlug, string $pageSlug)
{
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
$this->checkOwnablePermission('page-view', $page);
@ -696,7 +698,7 @@ class PageController extends Controller
* @throws NotFoundException
* @throws \Throwable
*/
public function permissions($bookSlug, $pageSlug, Request $request)
public function permissions(Request $request, string $bookSlug, string $pageSlug)
{
$page = $this->pageRepo->getPageBySlug($pageSlug, $bookSlug);
$this->checkOwnablePermission('restrictions-manage', $page);