Skip to content

Commit 2922959

Browse files
committed
fix: messaging
1 parent 8c516af commit 2922959

3 files changed

Lines changed: 23 additions & 6 deletions

File tree

src/Database/Migration/Shortcut/DateColumn.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ public function addTimestamps(): Table
9999
return $this;
100100
}
101101

102+
/**
103+
* Add default timestamps
104+
*
105+
* @return Table
106+
* @throws SQLGeneratorException
107+
*/
108+
public function addSoftDelete(): Table
109+
{
110+
if ($this->adapter == 'pgsql') {
111+
$this->addTimestamp('deleted_at', ['default' => 'CURRENT_TIMESTAMP', 'nullable' => true]);
112+
} else {
113+
$this->addColumn('updated_at', 'datetime', ['nullable' => true]);
114+
}
115+
116+
return $this;
117+
}
118+
102119
/**
103120
* Change datetime column
104121
*

src/Messaging/Messaging.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function process(Model $context): void
106106
foreach ($channels as $channel) {
107107
if (array_key_exists($channel, static::$channels)) {
108108
$target_channel = new static::$channels[$channel]();
109-
$target_channel->send($context);
109+
$target_channel->send($context, $this);
110110
}
111111
}
112112
}

src/Support/helpers.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,17 +1220,17 @@ function app_mode(): string
12201220
*/
12211221
function app_in_debug(): bool
12221222
{
1223-
return (bool)app_env('APP_DEBUG');
1223+
return (bool) app_env('APP_DEBUG');
12241224
}
12251225
}
12261226

12271227
if (!function_exists('client_locale')) {
12281228
/**
12291229
* Get client request language
12301230
*
1231-
* @return string
1231+
* @return ?string
12321232
*/
1233-
function client_locale(): string
1233+
function client_locale(): ?string
12341234
{
12351235
return request()->lang();
12361236
}
@@ -1259,7 +1259,7 @@ function old(string $key, mixed $fullback = null): mixed
12591259
* @throws AuthenticationException
12601260
* @deprecated
12611261
*/
1262-
function auth(string $guard = null): GuardContract
1262+
function auth(?string $guard = null): GuardContract
12631263
{
12641264
$auth = Auth::getInstance();
12651265

@@ -1279,7 +1279,7 @@ function auth(string $guard = null): GuardContract
12791279
* @return GuardContract
12801280
* @throws AuthenticationException
12811281
*/
1282-
function app_auth(string $guard = null): GuardContract
1282+
function app_auth(?string $guard = null): GuardContract
12831283
{
12841284
$auth = Auth::getInstance();
12851285

0 commit comments

Comments
 (0)