PHP Class BookStack\Http\Controllers\ImageController

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

Protected Properties

Property Type Description
$file
$image
$imageRepo

Public Methods

Method Description
__construct ( Image $image, Illuminate\Filesystem\Filesystem $file, ImageRepo $imageRepo ) ImageController constructor.
destroy ( PageRepo $pageRepo, Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\JsonResponse Deletes an image and all thumbnail/image files
getAllByType ( string $type, integer $page ) : Illuminate\Http\JsonResponse Get all images for a specific type, Paginated
getAllForUserType ( integer $page ) : Illuminate\Http\JsonResponse Get all images for a user.
getGalleryFiltered ( $filter, integer $page, Illuminate\Http\Request $request ) Get gallery images with a specific filter such as book or page
getThumbnail ( $id, $width, $height, $crop ) : Illuminate\Http\JsonResponse Generate a sized thumbnail for an image.
searchByType ( $type, integer $page, Illuminate\Http\Request $request ) : mixed Search through images within a particular type.
update ( integer $imageId, Illuminate\Http\Request $request ) : Illuminate\Http\JsonResponse Update image details
uploadByType ( string $type, Illuminate\Http\Request $request ) : Illuminate\Http\JsonResponse Handles image uploads for use on pages.

Method Details

__construct() public method

ImageController constructor.
public __construct ( Image $image, Illuminate\Filesystem\Filesystem $file, ImageRepo $imageRepo )
$image BookStack\Image
$file Illuminate\Filesystem\Filesystem
$imageRepo BookStack\Repos\ImageRepo

destroy() public method

Deletes an image and all thumbnail/image files
public destroy ( PageRepo $pageRepo, Illuminate\Http\Request $request, integer $id ) : Illuminate\Http\JsonResponse
$pageRepo BookStack\Repos\PageRepo
$request Illuminate\Http\Request
$id integer
return Illuminate\Http\JsonResponse

getAllByType() public method

Get all images for a specific type, Paginated
public getAllByType ( string $type, integer $page ) : Illuminate\Http\JsonResponse
$type string
$page integer
return Illuminate\Http\JsonResponse

getAllForUserType() public method

Get all images for a user.
public getAllForUserType ( integer $page ) : Illuminate\Http\JsonResponse
$page integer
return Illuminate\Http\JsonResponse

getGalleryFiltered() public method

Get gallery images with a specific filter such as book or page
public getGalleryFiltered ( $filter, integer $page, Illuminate\Http\Request $request )
$filter
$page integer
$request Illuminate\Http\Request

getThumbnail() public method

Generate a sized thumbnail for an image.
public getThumbnail ( $id, $width, $height, $crop ) : Illuminate\Http\JsonResponse
$id
$width
$height
$crop
return Illuminate\Http\JsonResponse

searchByType() public method

Search through images within a particular type.
public searchByType ( $type, integer $page, Illuminate\Http\Request $request ) : mixed
$type
$page integer
$request Illuminate\Http\Request
return mixed

update() public method

Update image details
public update ( integer $imageId, Illuminate\Http\Request $request ) : Illuminate\Http\JsonResponse
$imageId integer
$request Illuminate\Http\Request
return Illuminate\Http\JsonResponse

uploadByType() public method

Handles image uploads for use on pages.
public uploadByType ( string $type, Illuminate\Http\Request $request ) : Illuminate\Http\JsonResponse
$type string
$request Illuminate\Http\Request
return Illuminate\Http\JsonResponse

Property Details

$file protected property

protected $file

$image protected property

protected $image

$imageRepo protected property

protected $imageRepo