mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
only my meetups events calendar stream url added
This commit is contained in:
@@ -24,6 +24,15 @@ class DownloadMeetupCalendar extends Controller
|
||||
->findOrFail($request->input('meetup'));
|
||||
$events = $meetup->meetupEvents;
|
||||
$image = $meetup->getFirstMediaUrl('logo');
|
||||
} elseif ($request->has('my')) {
|
||||
$ids = auth()->user()->meetups->pluck('id')->toArray();
|
||||
$events = MeetupEvent::query()
|
||||
->with([
|
||||
'meetup',
|
||||
])
|
||||
->whereHas('meetup', fn($query) => $query->whereIn('meetups.id', $ids))
|
||||
->get();
|
||||
$image = asset('img/einundzwanzig-horizontal.png');
|
||||
} else {
|
||||
$events = MeetupEvent::query()
|
||||
->with([
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Livewire\Meetup;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\MeetupEvent;
|
||||
use App\Traits\HasMapEmbedCodeTrait;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
use WireUi\Traits\Actions;
|
||||
@@ -11,6 +12,7 @@ use WireUi\Traits\Actions;
|
||||
class MeetupEventTable extends Component
|
||||
{
|
||||
use Actions;
|
||||
use HasMapEmbedCodeTrait;
|
||||
|
||||
public Country $country;
|
||||
|
||||
|
||||
@@ -4,21 +4,16 @@ namespace App\Http\Livewire\Meetup;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\Meetup;
|
||||
use App\Traits\HasMapEmbedCodeTrait;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
class MeetupTable extends Component
|
||||
{
|
||||
use HasMapEmbedCodeTrait;
|
||||
|
||||
public Country $country;
|
||||
|
||||
public string $mapEmbedCode = '';
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->mapEmbedCode = '<iframe src="'.url()->route('meetup.embed.countryMap',
|
||||
['country' => $this->country->code]).'" width="100%" height="500" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>';
|
||||
}
|
||||
|
||||
public function filterByMarker($id)
|
||||
{
|
||||
$meetup = Meetup::with(['city.country'])
|
||||
|
||||
15
app/Traits/HasMapEmbedCodeTrait.php
Normal file
15
app/Traits/HasMapEmbedCodeTrait.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits;
|
||||
|
||||
trait HasMapEmbedCodeTrait
|
||||
{
|
||||
public string $mapEmbedCode = '';
|
||||
|
||||
public function mountHasMapEmbedCodeTrait()
|
||||
{
|
||||
$this->mapEmbedCode = '<iframe src="'.url()->route('meetup.embed.countryMap',
|
||||
['country' => $this->country->code]).'" width="100%" height="500" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>';
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user