Add restrictions for a page query
public enforcePageRestrictions ( $query, string $action = 'view' ) : mixed | ||
$query | ||
$action | string | |
리턴 | mixed |
/** * Get the most recently updated pages. * @param $count * @param int $page * @return mixed */ public function getRecentlyUpdatedPages($count = 20, $page = 0) { return $this->permissionService->enforcePageRestrictions($this->page)->where('draft', '=', false)->orderBy('updated_at', 'desc')->with('book')->skip($page * $count)->take($count)->get(); }