*/
public function getRecentlyCreated(User $user, $count = 20)
{
- $createdByUserQuery = function(Builder $query) use ($user) {
+ $createdByUserQuery = function (Builder $query) use ($user) {
$query->where('created_by', '=', $user->id);
};
*/
protected function checkPermissionOrCurrentUser(string $permissionName, int $userId)
{
- return $this->checkPermissionOr($permissionName, function() use ($userId) {
+ return $this->checkPermissionOr($permissionName, function () use ($userId) {
return $userId === $this->currentUser->id;
});
}
ImageService $imageService,
PermissionService $permissionService,
Page $page
- )
- {
+ ) {
$this->image = $image;
$this->imageService = $imageService;
$this->restrictionService = $permissionService;
int $uploadedTo = null,
string $search = null,
callable $whereClause = null
- )
- {
+ ) {
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
if ($uploadedTo !== null) {
int $pageSize = 24,
int $uploadedTo = null,
string $search = null
- )
- {
+ ) {
$contextPage = $this->page->findOrFail($uploadedTo);
$parentFilter = null;
if ($filterType === 'book' || $filterType === 'page') {
- $parentFilter = function(Builder $query) use ($filterType, $contextPage) {
+ $parentFilter = function (Builder $query) use ($filterType, $contextPage) {
if ($filterType === 'page') {
$query->where('uploaded_to', '=', $contextPage->id);
} elseif ($filterType === 'book') {
int $resizeWidth = null,
int $resizeHeight = null,
bool $keepRatio = true
- )
- {
+ ) {
$imageName = $uploadedFile->getClientOriginalName();
$imageData = file_get_contents($uploadedFile->getRealPath());
* Check if the current user has general access.
* @return bool
*/
-function hasAppAccess() : bool {
+function hasAppAccess() : bool
+{
return !auth()->guest() || setting('app-public');
}