use Illuminate\View\Component;
class AddStreamsToCalendar extends Component
{
public string $webcalLink;
public function __construct()
{
$url = parse_url(route('calendar.ics'));
$webcalLink = "webcal://{$url['host']}{$url['path']}";
$this->webcalLink = $webcalLink;
}
public function render()
{
return view('components.add-streams-to-calendar');
}
}
<div class="relative z-0 inline-flex shadow-sm rounded-md" x-data="{ show: false }">
<a
href="{{ $webcalLink }}"
class="relative flex items-center px-3 py-2 text-sm font-medium text-white transition bg-red-600 rounded-md rounded-r-none shadow hover:bg-red-500 focus:bg-red-700 focus:outline-none focus:ring focus:ring-red-400"
>
Add streams to calendar
</a>
//
</div>
Additional resources on blade components:
-
Povilas Korop | www.youtube.com
Published on
-
Povilas Korop | www.youtube.com
Published on
-
Blade components for your layout
Article
Marcel Pociot | beyondco.de
Published on
-
Article
Eric The Coder | dev.to
Published on