Skip to content

Commit 4c661f1

Browse files
committed
REFACTOR - To use arrow function
1 parent 163c485 commit 4c661f1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/Jobs/GenerateSocialShareImage.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function handle(): Response
3434
return Cache::remember(
3535
'articleSocialImage-' . $this->article->id,
3636
now()->addDay(),
37-
function () use ($image, $text) {
38-
return response(
37+
fn () =>
38+
response(
3939
$image->read(resource_path('images/' . self::TEMPLATE))
4040
->text($text, self::TEXT_X_POSITION, self::TEXT_Y_POSITION, function ($font) {
4141
$font->file(resource_path('fonts/' . self::FONT));
@@ -44,8 +44,7 @@ function () use ($image, $text) {
4444
})
4545
->toPng()
4646
)->header('Content-Type', 'image/png')
47-
->header('Cache-Control', 'max-age=86400, public');
48-
}
47+
->header('Cache-Control', 'max-age=86400, public')
4948
);
5049
}
5150
}

0 commit comments

Comments
 (0)