You've already forked pilot-sdk
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 162688ceb4 | |||
| 95be4fc5a9 | |||
| dec195e619 |
@@ -23,12 +23,13 @@ abstract class Action extends Entity
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function file(
|
public function file(
|
||||||
string $contents,
|
string $path,
|
||||||
string $name = '',
|
string $name = '',
|
||||||
string $type = ''
|
string $type = '',
|
||||||
|
bool $deleteAfterDownload = false,
|
||||||
) {
|
) {
|
||||||
return [
|
return [
|
||||||
'file' => compact('contents', 'name', 'type'),
|
'file' => compact('path', 'name', 'type', 'deleteAfterDownload'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,6 +67,24 @@ abstract class Action extends Entity
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function exportMetrics(
|
||||||
|
?string $entry = null,
|
||||||
|
?array $entries = null,
|
||||||
|
?string $filter = null,
|
||||||
|
?array $metrics = null
|
||||||
|
)
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'json' => [
|
||||||
|
'type' => 'export-metrics',
|
||||||
|
'entry' => $entry,
|
||||||
|
'entries' => $entries,
|
||||||
|
'filter' => $filter,
|
||||||
|
'metrics' => $metrics,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
public function error(string $message)
|
public function error(string $message)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -96,12 +96,12 @@ class PilotServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
if (isset($output['file'])) {
|
if (isset($output['file'])) {
|
||||||
return response()->download(
|
return response()->download(
|
||||||
$output['file']['content'],
|
$output['file']['path'],
|
||||||
$output['file']['name'],
|
$output['file']['name'] ?? null,
|
||||||
[
|
! empty($output['file']['type']) ? [
|
||||||
'Content-Type' => $output['file']['type'],
|
'Content-Type' => $output['file']['type'],
|
||||||
]
|
] : []
|
||||||
);
|
)->deleteFileAfterSend(isset($output['file']['deleteAfterDownload']) ? $output['file']['deleteAfterDownload'] : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response();
|
return response();
|
||||||
|
|||||||
Reference in New Issue
Block a user