Skip to content

Commit

Permalink
intervention/imagecache implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
burakcakirel committed Jul 22, 2020
1 parent d934bc4 commit bc2f279
Show file tree
Hide file tree
Showing 4 changed files with 334 additions and 39 deletions.
6 changes: 4 additions & 2 deletions app/Http/ViewComposers/Logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ public function compose(View $view)
$path = base_path('public/img/company.png');
}

$width = $height = setting('invoice.logo_size', 128);
$image = Image::cache(function($image) use ($path) {
$width = $height = setting('invoice.logo_size', 128);

$image = Image::make($path)->resize($width, $height)->encode()->getEncoded();
$image->make($path)->resize($width, $height)->encode();
});

if (empty($image)) {
return $logo;
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"graham-campbell/markdown": "12.0.*",
"guzzlehttp/guzzle": "^6.5",
"intervention/image": "2.5.*",
"intervention/imagecache": "^2.4",
"kyslik/column-sortable": "^6.0",
"laracasts/flash": "3.1.*",
"laravel/framework": "^7.0",
Expand Down
295 changes: 258 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bc2f279

Please sign in to comment.