Skip to content

Commit

Permalink
refactor: Laravel Pint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
secondnetwork authored and github-actions[bot] committed Dec 20, 2023
1 parent 0ffdf4d commit a39e4b8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 22 deletions.
22 changes: 11 additions & 11 deletions src/Helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\File;
use Secondnetwork\Kompass\Models\File as Files;

if (! function_exists('vendor_path')) {
/**
* Get the path to the litstack package vendor folder.
Expand All @@ -21,31 +22,30 @@ function vendor_path(string $path = '')
function get_thumbnails($id_media, $class = null, $size = null)
{

$file = Files::where('id', $id_media)->first();
if ($file) {
if ($size) {
$sizes = '_'.$size;
$file = Files::where('id', $id_media)->first();
if ($file) {
if ($size) {
$sizes = '_'.$size;

return '<picture>
return '<picture>
<source type="image/avif" srcset="'.asset('storage/'.$file->path.'/'.$file->slug).'.avif">
<img class="'.$class.'" src="'.asset('storage'.$file->path.'/'.$file->slug.$sizes.'.'.$file->extension).'" alt="'.$file->alt.'" />
</picture>
';
} else {
return '<picture>
} else {
return '<picture>
<source type="image/avif" srcset="'.asset('storage/'.$file->path.'/'.$file->slug).'.avif">
<img class="'.$class.'" src="'.asset('storage'.$file->path.'/'.$file->slug.'.'.$file->extension).'" alt="'.$file->alt.'" />
</picture>
';
}
}
}

return '';

return '';

}
}


if (! function_exists('kompass_asset')) {
function kompass_asset($path, $secure = null)
{
Expand Down
13 changes: 4 additions & 9 deletions src/Livewire/Frontend/Blogview.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@

namespace Secondnetwork\Kompass\Livewire\Frontend;

use Livewire\Component;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\Facades\Cache;
use Secondnetwork\Kompass\Models\File;
use Secondnetwork\Kompass\Models\Post;
use Secondnetwork\Kompass\Models\Block;
use Livewire\Component;
use RalphJSmit\Laravel\SEO\Support\SEOData;
use Secondnetwork\Kompass\Models\Block;
use Secondnetwork\Kompass\Models\Datafields;
use Secondnetwork\Kompass\Models\File;
use Secondnetwork\Kompass\Models\Post;

class Blogview extends Component
{
Expand Down Expand Up @@ -89,7 +87,6 @@ public function get_gallery($blockis = null)
public function get_field($type, $blockis = null, $class = null, $size = null)
{


foreach ($this->fields as $value) {

if ($blockis == $value->block_id) {
Expand Down Expand Up @@ -132,8 +129,6 @@ public function get_field($type, $blockis = null, $class = null, $size = null)

}



}
}

Expand Down
4 changes: 2 additions & 2 deletions src/Livewire/Medialibrary.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ public function selectField($media_id, $fieldOrPageName)
case 'setting':
Setting::updateOrCreate(['id' => $this->field_id], ['thumbnails' => $media_id]);
$this->dispatch('refreshmedia');
break;
break;

default:
Datafields::updateOrCreate(
['id' => $this->field_id], [
Expand Down

0 comments on commit a39e4b8

Please sign in to comment.