Install
Laravel (Blade)
Add the booking widget to a Laravel Blade view.
The CDN bundle drops directly into a Blade view. Read the API key from config so you don't hard-code it in Blade.
'medos' => [
'api_key' => env('MEDOS_API_KEY'),
],@extends('layouts.app')
@section('content')
<h1>Book an appointment</h1>
<div id="medos-booking" style="min-height: 600px"></div>
@endsection
@push('scripts')
<script src="https://widgets.medos.one/v2/unified.js"></script>
<script>
MedosBooking.init({
apiKey: @json(config('services.medos.api_key')),
mode: "inline",
containerId: "medos-booking",
theme: "default",
});
</script>
@endpushWhy @json()?
@json() safely escapes the value for a JavaScript context. Never
interpolate an API key directly into a <script> tag with {{ }} — that
can break with special characters.