Skip to content

Commit

Permalink
Refactored app.blade.php to use class_exists instead of View::exists …
Browse files Browse the repository at this point in the history
…for checking if a class exists and config values for enabling/disabling certain components. (#7)
  • Loading branch information
thejmitchener authored Nov 13, 2024
1 parent ec9111c commit 729604d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions resources/views/components/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,33 @@
@if (View::exists('googletagmanager::head') && config('app-wrapper.gtm_enabled'))
@include('googletagmanager::head')
@endif

@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('layouts-wrapper.gtm_enabled'))
@include('googletagmanager::head')
@endif
</head>
<body>
@if (View::exists('navigation::components.navigation') && config('app-wrapper.navigation_enabled'))
@if (class_exists(\Fuelviews\Navigation\Navigation::class) && config('layouts-wrapper.navigation_enabled'))
@component('navigation::components.navigation')
@endcomponent
@endif

{{ $slot }}

@if (View::exists('navigation::components.footer.footer') && config('app-wrapper.footer_enabled'))
@if (class_exists(\Fuelviews\Navigation\View\Components\Footer\Footer::class) && config('layouts-wrapper.footer_enabled'))
@component('navigation::components.footer.footer')
@endcomponent
@endif

@if (View::exists('forms::livewire.forms-modal') && config('app-wrapper.forms_modal_enabled'))
@if (class_exists(\Fuelviews\Forms\Forms::class) && config('layouts-wrapper.forms_modal_enabled'))
@livewire('forms-modal')
@endif

@if (View::exists('googletagmanager::body') && config('app-wrapper.gtm_enabled'))
@if (class_exists(\Spatie\GoogleTagManager\GoogleTagManager::class) && config('layouts-wrapper.gtm_enabled'))
@include('googletagmanager::body')
@endif

@if (class_exists(\Livewire\Livewire::class) && config('app-wrapper.livewire_enabled'))
@if (class_exists(\Livewire\Livewire::class) && config('layouts-wrapper.livewire_enabled'))
@livewireScripts
@endif
</body>
Expand Down

0 comments on commit 729604d

Please sign in to comment.