mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-13 15:07:49 +00:00
This commit is contained in:
parent
c67a182cf2
commit
b4b6286172
89 changed files with 672 additions and 666 deletions
|
|
@ -13,15 +13,10 @@ class BatteryLow extends Notification
|
|||
{
|
||||
use Queueable;
|
||||
|
||||
private Device $device;
|
||||
|
||||
/**
|
||||
* Create a new notification instance.
|
||||
*/
|
||||
public function __construct(Device $device)
|
||||
{
|
||||
$this->device = $device;
|
||||
}
|
||||
public function __construct(private Device $device) {}
|
||||
|
||||
/**
|
||||
* Get the notification's delivery channels.
|
||||
|
|
|
|||
|
|
@ -11,13 +11,7 @@ use Illuminate\Support\Arr;
|
|||
|
||||
class WebhookChannel extends Notification
|
||||
{
|
||||
/** @var Client */
|
||||
protected $client;
|
||||
|
||||
public function __construct(Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
public function __construct(protected Client $client) {}
|
||||
|
||||
/**
|
||||
* Send the given notification.
|
||||
|
|
|
|||
|
|
@ -13,13 +13,6 @@ final class WebhookMessage extends Notification
|
|||
*/
|
||||
private $query;
|
||||
|
||||
/**
|
||||
* The POST data of the Webhook request.
|
||||
*
|
||||
* @var mixed
|
||||
*/
|
||||
private $data;
|
||||
|
||||
/**
|
||||
* The headers to send with the request.
|
||||
*
|
||||
|
|
@ -36,9 +29,8 @@ final class WebhookMessage extends Notification
|
|||
|
||||
/**
|
||||
* @param mixed $data
|
||||
* @return static
|
||||
*/
|
||||
public static function create($data = '')
|
||||
public static function create($data = ''): self
|
||||
{
|
||||
return new self($data);
|
||||
}
|
||||
|
|
@ -46,10 +38,12 @@ final class WebhookMessage extends Notification
|
|||
/**
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function __construct($data = '')
|
||||
{
|
||||
$this->data = $data;
|
||||
}
|
||||
public function __construct(
|
||||
/**
|
||||
* The POST data of the Webhook request.
|
||||
*/
|
||||
private $data = ''
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Set the Webhook parameters to be URL encoded.
|
||||
|
|
@ -57,7 +51,7 @@ final class WebhookMessage extends Notification
|
|||
* @param mixed $query
|
||||
* @return $this
|
||||
*/
|
||||
public function query($query)
|
||||
public function query($query): self
|
||||
{
|
||||
$this->query = $query;
|
||||
|
||||
|
|
@ -70,7 +64,7 @@ final class WebhookMessage extends Notification
|
|||
* @param mixed $data
|
||||
* @return $this
|
||||
*/
|
||||
public function data($data)
|
||||
public function data($data): self
|
||||
{
|
||||
$this->data = $data;
|
||||
|
||||
|
|
@ -84,7 +78,7 @@ final class WebhookMessage extends Notification
|
|||
* @param string $value
|
||||
* @return $this
|
||||
*/
|
||||
public function header($name, $value)
|
||||
public function header($name, $value): self
|
||||
{
|
||||
$this->headers[$name] = $value;
|
||||
|
||||
|
|
@ -97,7 +91,7 @@ final class WebhookMessage extends Notification
|
|||
* @param string $userAgent
|
||||
* @return $this
|
||||
*/
|
||||
public function userAgent($userAgent)
|
||||
public function userAgent($userAgent): self
|
||||
{
|
||||
$this->headers['User-Agent'] = $userAgent;
|
||||
|
||||
|
|
@ -109,17 +103,14 @@ final class WebhookMessage extends Notification
|
|||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function verify($value = true)
|
||||
public function verify($value = true): self
|
||||
{
|
||||
$this->verify = $value;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function toArray()
|
||||
public function toArray(): array
|
||||
{
|
||||
return [
|
||||
'query' => $this->query,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue