Skip to content

Commit f102164

Browse files
committed
Update packages
1 parent 7127297 commit f102164

File tree

14 files changed

+305
-310
lines changed

14 files changed

+305
-310
lines changed

app/Models/Post.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function boot()
101101
});
102102

103103
static::created(function (Post $post) {
104-
dispatch(fn () => $this->notifyAboutPublishedPost($post))->afterResponse();
104+
dispatch(fn() => $post->notifyAboutPublishedPost())->afterResponse();
105105
});
106106
}
107107

@@ -200,27 +200,22 @@ public function getDescriptionAttribute()
200200
return Str::of($this->content)->words(30)->markdown()->stripTags();
201201
}
202202

203-
/**
204-
* @param Post $post
205-
*
206-
* @return void
207-
*/
208-
public function notifyAboutPublishedPost(Post $post): void
203+
public function notifyAboutPublishedPost(): void
209204
{
210205
try {
211206
if (config('app.env') == 'local') {
212207
return;
213208
}
214209

215210
// Не отправляем нотификацию, если публикация запланирована в будущее
216-
if ($post->published_at?->isFuture()) {
211+
if ($this->published_at?->isFuture()) {
217212
return;
218213
}
219214

220215
TelegramMessage::create()
221216
->to(config('services.telegram-bot-api.channel_id'))
222-
->escapedLine($post->title)
223-
->content(route('post.show', $post))
217+
->escapedLine($this->title)
218+
->content(route('post.show', $this))
224219
->send();
225220
} catch (\Throwable $e) {
226221
report($e);

app/Orchid/Screens/Meet/ListScreen.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace App\Orchid\Screens\Meet;
44

55
use App\Models\Meet;
6+
use App\Models\Package;
67
use App\Notifications\SimpleMessageNotification;
78
use Illuminate\Http\Request;
89
use Illuminate\Support\Facades\Blade;
@@ -95,13 +96,9 @@ public function layout(): iterable
9596
->sort()
9697
->cantHide()
9798
->render(function (Meet $meet) {
98-
return "<strong class='d-block'>".e($meet->name).'</strong>';
99+
return "<strong class='d-block'>".e($meet->name)."</strong><span class='text-muted'>".e($meet->location)."</span>";
99100
})->filter(Input::make()),
100101

101-
TD::make('location', 'Адрес')
102-
->width(200)
103-
->filter(Input::make()),
104-
105102
TD::make('start_date', 'Начало')
106103
->usingComponent(DateTimeSplit::class)
107104
->width(150)
@@ -124,8 +121,7 @@ public function layout(): iterable
124121
->sort(),
125122

126123
TD::make('Добавил')
127-
->sort()
128-
->cantHide()
124+
->defaultHidden()
129125
->render(fn (Meet $meet) => new Persona($meet->author->presenter())),
130126

131127
TD::make('created_at', __('Created'))
@@ -153,7 +149,7 @@ public function layout(): iterable
153149
ModalToggle::make(__('Edit'))
154150
->icon('bs.pencil')
155151
->modal('editModal', [
156-
'meet' => $meet->id,
152+
'meet' => $meet,
157153
])
158154
->modalTitle($meet->name)
159155
->method('update', [
@@ -164,7 +160,7 @@ public function layout(): iterable
164160
->icon('bs.trash3')
165161
->confirm(__('Once the account is deleted, all of its resources and data will be permanently deleted. Before deleting your account, please download any data or information that you wish to retain.'))
166162
->method('remove', [
167-
'meet' => $meet->id,
163+
'meet' => $meet,
168164
]),
169165
])),
170166
]),

0 commit comments

Comments
 (0)