mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
copy embed code
This commit is contained in:
41
app/Http/Livewire/Meetup/Embed/CountryMap.php
Normal file
41
app/Http/Livewire/Meetup/Embed/CountryMap.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire\Meetup\Embed;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\Meetup;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
class CountryMap extends Component
|
||||
{
|
||||
public Country $country;
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.meetup.embed.country-map', [
|
||||
'markers' => Meetup::query()
|
||||
->with([
|
||||
'city.country',
|
||||
])
|
||||
->whereHas('city.country',
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn($meetup) => [
|
||||
'id' => $meetup->id,
|
||||
'name' => $meetup->name,
|
||||
'coords' => [$meetup->city->latitude, $meetup->city->longitude],
|
||||
'url' => url()->route('meetup.landing', [
|
||||
'country' => $meetup->city->country->code,
|
||||
'meetup' => $meetup,
|
||||
]),
|
||||
]),
|
||||
])->layout('layouts.app', [
|
||||
'SEOData' => new SEOData(
|
||||
title: __('Meetups'),
|
||||
description: __('Bitcoiner Meetups are a great way to meet other Bitcoiners in your area. You can learn from each other, share ideas, and have fun!'),
|
||||
image: asset('img/screenshot.png')
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user