Creating Custom Templates

Creating your own template allows you to match your application's branding perfectly. Let's walk through the process:

  • First, publish the package views:

php artisan vendor:publish --tag="curtain-views"
  • Create your template file:

touch resources/views/vendor/curtain/templates/custom.blade.php
  • Basic template structure:

@extends('curtain::templates.base')

@push('styles')
    {{-- Add your custom styles here --}}
    <link href="https://fonts.googleapis.com/css2?family=Your+Font:wght@400;700&display=swap" rel="stylesheet">
@endpush

@section('content')
    <div class="your-custom-container">
        {{-- Include essential components --}}
        @include('curtain::components.status')
        @include('curtain::components.countdown')
        
        {{-- Add your custom content --}}
    </div>
@endsection
  • Register your template:

// config/curtain.php
'templates' => [
    'custom' => [
        'name' => 'Your Custom Template',
        'view' => 'vendor.curtain.templates.custom',
    ],
],

Last updated