Finish share button and added gallery buttons

This commit is contained in:
2026-07-02 11:40:38 +02:00
parent 9f7104fcf3
commit ca7799d1f3
6 changed files with 219 additions and 27 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace App\View\Components;
use App\Models\Entry;
use App\Models\News;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class ShareRhpzUrl extends Component
{
/**
* Create a new component instance.
*/
public function __construct(
public Entry|News $entry,
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
if( ( $this->entry->type ?? "news" ) === 'news' ){
$letter = 'n';
} else {
$letter = $this->entry->type[0];
}
$id = $this->entry->id;
$shareUrl = config('app.share_url');
$url = rtrim($shareUrl, '/') . '/' . $letter . '/' . $id;
return view('components.share-rhpz-url', compact('url') );
}
}