API reference / Quittio \ Laravel \ Rendering
DeliversFile
trait in quittio/laravel
Quittio\Laravel\Rendering\DeliversFile · Source
Download, inline display, mail attachment and storage for rendered files.
Methods#
| Method | Description |
|---|---|
->contents() | |
->download() | |
->filename() | |
->mimeType() | |
->save() | Stores the main output on a filesystem disk (default: quittio.storage.disk). |
->stream() | |
->toMailAttachment() | |
->toResponse() |
contents()#
abstract public function contents(): string- Returns
string
download()#
public function download(?string $filename = null): Response| Parameter | Type | Description |
|---|---|---|
$filename | ?string = null |
- Returns
Symfony\Component\HttpFoundation\Response
filename()#
abstract public function filename(?string $extension = null): string| Parameter | Type | Description |
|---|---|---|
$extension | ?string = null |
- Returns
string
mimeType()#
abstract public function mimeType(): string- Returns
string
save()#
public function save(?string $disk = null, ?string $path = null): stringStores the main output on a filesystem disk (default: quittio.storage.disk).
| Parameter | Type | Description |
|---|---|---|
$disk | ?string = null | |
$path | ?string = null |
- Returns
string– the stored path- Throws
RuntimeException– when the disk does not store the file
stream()#
public function stream(?string $filename = null): Response| Parameter | Type | Description |
|---|---|---|
$filename | ?string = null |
- Returns
Symfony\Component\HttpFoundation\Response
toMailAttachment()#
public function toMailAttachment(): Attachment- Returns
Illuminate\Mail\Attachment
toResponse()#
public function toResponse(Request $request): Response| Parameter | Type | Description |
|---|---|---|
$request | Illuminate\Http\Request |
- Returns
Symfony\Component\HttpFoundation\Response