diff --git a/assets/vendor/adrema-form b/assets/vendor/adrema-form index 71c9255..e0ab18a 160000 --- a/assets/vendor/adrema-form +++ b/assets/vendor/adrema-form @@ -1 +1 @@ -Subproject commit 71c92559b8c220442b43d9ea52bbcb8e9bb23221 +Subproject commit e0ab18a469a831b85f61e10f32d1ad6ede366f43 diff --git a/components/EventManager.php b/components/EventManager.php index 5564e17..6fe4b0d 100644 --- a/components/EventManager.php +++ b/components/EventManager.php @@ -8,13 +8,13 @@ use Cms\Classes\Page; use Silva\Adrema\Exceptions\ComponentException; use Silva\Adrema\Models\Settings; use Silva\Adrema\Support\FetchAllEvents; -use Silva\Adrema\Support\FetchSingleEvent; abstract class EventManager extends ComponentBase { public array $settings = []; public ?array $event = null; + public array $eventMeta = []; /** @var Collection */ public Collection $events; @@ -149,6 +149,7 @@ abstract class EventManager extends ComponentBase return; } + $this->eventMeta = data_get(app(FetchAllEvents::class)->run(), 'meta', []); $this->events = $this->page['events'] = collect(app(FetchAllEvents::class)->run()['data']); $this->event = $this->page['event'] = $this->events->first(fn ($event) => $event['slug'] == $eventSlug); $this->currentUrl = url()->current(); diff --git a/support/Proxy.php b/support/Proxy.php index 4549cd6..77d6425 100644 --- a/support/Proxy.php +++ b/support/Proxy.php @@ -21,7 +21,12 @@ class Proxy public function submit(string $url): JsonResponse { - $response = Http::acceptJson()->post($this->url($url), request()->input()); + $headers = request()->header('X-Adrema-Token') + ? [ + 'Authorization' => 'Bearer ' . request()->header('X-Adrema-Token'), + ] + : []; + $response = Http::acceptJson()->withHeaders($headers)->post($this->url($url), request()->input()); return response()->json($response->json(), $response->status()); } diff --git a/views/head.htm b/views/head.htm index 2a2b7de..41ca8f4 100644 --- a/views/head.htm +++ b/views/head.htm @@ -9,6 +9,7 @@ {% endif %}