You've already forked pilot-sdk
first commit
This commit is contained in:
42
src/Entity/Action.php
Normal file
42
src/Entity/Action.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Bluesquare\Pilot\Entity;
|
||||
|
||||
abstract class Action extends Entity
|
||||
{
|
||||
public function action(
|
||||
$type = 'info',
|
||||
$title = null,
|
||||
$message = null,
|
||||
$button = null,
|
||||
$url = null,
|
||||
$files = [],
|
||||
) {
|
||||
return [
|
||||
'json' => [
|
||||
'type' => 'action',
|
||||
'action' => compact('type', 'title', 'message', 'button', 'url', 'files'),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function file(
|
||||
$contents,
|
||||
$name = '',
|
||||
$type = ''
|
||||
) {
|
||||
return [
|
||||
'file' => compact('contents', 'name', 'type'),
|
||||
];
|
||||
}
|
||||
|
||||
public function error($message)
|
||||
{
|
||||
return [
|
||||
'json' => [
|
||||
'type' => 'error',
|
||||
'error' => $message,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user