layoutMaster
to select vertical or horizontal layout. This option can be updated from custom.php
file. Find
customization-options here
We have included styles and scripts files in Common Master Layout. You can find these files at the same path inside resources/views/layouts
folder.
<!DOCTYPE html>
@php
use Illuminate\Support\Str;
use App\Helpers\Helpers;
$menuFixed =
$configData['layout'] === 'vertical'
? $menuFixed ?? ''
: ($configData['layout'] === 'front'
? ''
: $configData['headerType']);
$navbarType =
$configData['layout'] === 'vertical'
? $configData['navbarType']
: ($configData['layout'] === 'front'
? 'layout-navbar-fixed'
: '');
$isFront = ($isFront ?? '') == true ? 'Front' : '';
$contentLayout = isset($container) ? ($container === 'container-xxl' ? 'layout-compact' : 'layout-wide') : '';
// Get skin name from configData - only applies to admin layouts
$isAdminLayout = !Str::contains($configData['layout'] ?? '', 'front');
$skinName = $isAdminLayout ? $configData['skinName'] ?? 'default' : 'default';
// Get semiDark value from configData - only applies to admin layouts
$semiDarkEnabled = $isAdminLayout && filter_var($configData['semiDark'] ?? false, FILTER_VALIDATE_BOOLEAN);
// Generate primary color CSS if color is set
$primaryColorCSS = '';
if (isset($configData['color']) && $configData['color']) {
$primaryColorCSS = Helpers::generatePrimaryColorCSS($configData['color']);
}
@endphp
<html lang="{{ session()->get('locale') ?? app()->getLocale() }}"
class="{{ $navbarType ?? '' }} {{ $contentLayout ?? '' }} {{ $menuFixed ?? '' }} {{ $menuCollapsed ?? '' }} {{ $footerFixed ?? '' }} {{ $customizerHidden ?? '' }}"
dir=" {{ $configData['textDirection'] }}" data-skin="{{ $skinName }}" data-assets-path=" {{ asset('/assets') . '/' }}"
data-base-url="{{ url('/') }}" data-framework="laravel" data-template="{{ $configData['layout'] }}-menu-template"
data-bs-theme="{{ $configData['theme'] }}" @if ($isAdminLayout && $semiDarkEnabled) data-semidark-menu="true" @endif>
<head>
<meta charset="utf-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>
@yield('title') | {{ config('variables.templateName') ? config('variables.templateName') : 'TemplateName' }}
- {{ config('variables.templateSuffix') ? config('variables.templateSuffix') : 'TemplateSuffix' }}
</title>
<meta name="description"
content="{{ config('variables.templateDescription') ? config('variables.templateDescription') : '' }}" />
<meta name="keywords"
content="{{ config('variables.templateKeyword') ? config('variables.templateKeyword') : '' }}" />
<meta property="og:title" content="{{ config('variables.ogTitle') ? config('variables.ogTitle') : '' }}" />
<meta property="og:type" content="{{ config('variables.ogType') ? config('variables.ogType') : '' }}" />
<meta property="og:url" content="{{ config('variables.productPage') ? config('variables.productPage') : '' }}" />
<meta property="og:image" content="{{ config('variables.ogImage') ? config('variables.ogImage') : '' }}" />
<meta property="og:description"
content="{{ config('variables.templateDescription') ? config('variables.templateDescription') : '' }}" />
<meta property="og:site_name"
content="{{ config('variables.creatorName') ? config('variables.creatorName') : '' }}" />
<meta name="robots" content="noindex" />
<!-- laravel CRUD token -->
<meta name="csrf-token" content="{{ csrf_token() }}" />
<!-- Canonical SEO -->
<link rel="canonical" href="{{ config('variables.productPage') ? config('variables.productPage') : '' }}" />
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="{{ asset('assets/img/favicon/favicon.ico') }}" />
<!-- Include Styles -->
<!-- $isFront is used to append the front layout styles only on the front layout otherwise the variable will be blank -->
@include('layouts/sections/styles' . $isFront)
@if ($primaryColorCSS && (config('custom.custom.primaryColor') || isset($_COOKIE['admin-primaryColor']) || isset($_COOKIE['front-primaryColor'])))
<!-- Primary Color Style -->
<style id="primary-color-style">
{!! $primaryColorCSS !!}
</style>
@endif
<!-- Include Scripts for customizer, helper, analytics, config -->
<!-- $isFront is used to append the front layout scriptsIncludes only on the front layout otherwise the variable will be blank -->
@include('layouts/sections/scriptsIncludes' . $isFront)
</head>
<body>
<!-- Layout Content -->
@yield('layoutContent')
<!--/ Layout Content -->
{{- - remove while creating package - -}}
<div class="buy-now">
<a href="{{ config('variables.productPage') }}" target="_blank" class="btn btn-danger btn-buy-now">Buy Now</a>
</div>
{{- - remove while creating package end - -}}
<!-- Include Scripts -->
<!-- $isFront is used to append the front layout scripts only on the front layout otherwise the variable will be blank -->
@include('layouts/sections/scripts' . $isFront)
</body>
</html>
Included styles file contains all the core css, theme css, demo css and more..
You can find this file at layouts/sections/styles.blade.php
$configData
provides data from custom.php
to compile style according to layout settings.
<!-- BEGIN: Theme CSS-->
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet" />
<!-- Fonts Icons -->
@vite(['resources/assets/vendor/fonts/iconify/iconify.css'])
<!-- BEGIN: Vendor CSS-->
@if ($configData['hasCustomizer'])
@vite(['resources/assets/vendor/libs/pickr/pickr-themes.scss'])
@endif
<!-- Core CSS -->
@vite(['resources/assets/vendor/scss/core.scss', 'resources/assets/css/demo.css', 'resources/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.scss'])
<!-- Vendor Styles -->
@yield('vendor-style')
<!-- Page Styles -->
@yield('page-style')
This file includes helpers, customization, config js along with templateCustomizer initialization script :
You can find this file at layouts/sections/scriptsIncludes.blade.php
$configData
provides data from custom.php
to compile style according to layout settings.
@php
use Illuminate\Support\Facades\Vite;
$menuCollapsed = $configData['menuCollapsed'] === 'layout-menu-collapsed' ? json_encode(true) : false;
// Get skin value directly from the config, keeping it as numeric if applicable
$skin = $configData['skins'] ?? 0;
// If we have a skin name from cookie or other source, use that instead
$skinName = $configData['skinName'] ?? '';
// Use either the skin name or numeric ID, prioritizing the name if available
$defaultSkin = $skinName ?: $skin;
// Define layout type and cookie naming
$isAdminLayout = !str_contains($configData['layout'] ?? '', 'front');
$primaryColorCookieName = $isAdminLayout ? 'admin-primaryColor' : 'front-primaryColor';
// Get primary color - first from cookie, then from config
$primaryColor = isset($_COOKIE[$primaryColorCookieName])
? $_COOKIE[$primaryColorCookieName]
: $configData['color'] ?? null;
@endphp
<!-- laravel style -->
@vite(['resources/assets/vendor/js/helpers.js'])
<!-- beautify ignore:start -->
@if ($configData['hasCustomizer'])
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Template customizer: To hide customizer set displayCustomizer value false in config.js. -->
@vite(['resources/assets/vendor/js/template-customizer.js'])
@endif
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
@vite(['resources/assets/js/config.js'])
@if ($configData['hasCustomizer'])
<script type="module">
document.addEventListener('DOMContentLoaded', function() {
// Initialize template customizer after DOM is loaded
if (window.TemplateCustomizer) {
try {
// Get the skin currently applied to the document
const appliedSkin = document.documentElement.getAttribute('data-skin') || " {{ $defaultSkin }} ";
window.templateCustomizer = new TemplateCustomizer({
defaultTextDir: " {{ $configData['textDirection'] }} ",
@if ($primaryColor)
defaultPrimaryColor: " {{ $primaryColor }} ",
@endif
defaultTheme: " {{ $configData['themeOpt'] }} ",
defaultSkin: appliedSkin,
defaultSemiDark: {{ $configData['semiDark'] ? 'true' : 'false' }} ,
defaultShowDropdownOnHover: " {{ $configData['showDropdownOnHover'] }} ",
displayCustomizer: " {{ $configData['displayCustomizer'] }} ",
lang: ' {{ app()->getLocale() }} ',
'controls': <?php echo json_encode($configData['customizerControls']); ?>,
});
// Ensure color is applied on page load
@if ($primaryColor)
if (window.Helpers && typeof window.Helpers.setColor === 'function') {
window.Helpers.setColor(" {{ $primaryColor }} ", true);
}
@endif
} catch (error) {
console.warn('Template customizer initialization error:', error);
}
}
});
</script>
@endif
This file includes main js along with template related vendor scripts :
You can find this file at layouts/sections/scripts.blade.php
<!-- BEGIN: Vendor JS-->
@vite([
'resources/assets/vendor/libs/jquery/jquery.js',
'resources/assets/vendor/libs/popper/popper.js',
'resources/assets/vendor/js/bootstrap.js'])
@if ($configData['hasCustomizer'])
@vite([
'resources/assets/vendor/libs/@algolia/autocomplete-js.js',
'resources/assets/vendor/libs/pickr/pickr.js'
])
@endif
@vite([
'resources/assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js',
'resources/assets/vendor/libs/hammer/hammer.js',
'resources/assets/vendor/js/menu.js'
])
@yield('vendor-script')
<!-- END: Page Vendor JS-->
<!-- BEGIN: Theme JS-->
@vite(['resources/assets/js/main.js'])
<!-- END: Theme JS-->
<!-- Pricing Modal JS-->
@stack('pricing-script')
<!-- END: Pricing Modal JS-->
<!-- BEGIN: Page JS-->
@yield('page-script')
<!-- END: Page JS-->
This layout used for front pages
We have added Common Master Layout, Navbar-front and Navbar-front in Layout Front. You can find these files at the path inside resources/views/layouts
folder.
@php
$configData = Helper::appClasses();
$isFront = true;
@endphp
@section('layoutContent')
@extends('layouts/commonMaster')
@include('layouts/sections/navbar/navbar-front')
<!-- Sections:Start -->
@yield('content')
<!-- / Sections:End -->
@include('layouts/sections/footer/footer-front')
@endsection
Included styles file contains all the core css, theme css, demo css and more..
You can find this file at layouts/sections/stylesFront.blade.php
<!-- BEGIN: Theme CSS-->
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap"
rel="stylesheet">
@vite(['resources/assets/vendor/fonts/iconify/iconify.css'])
@if ($configData['hasCustomizer'])
@vite(['resources/assets/vendor/libs/pickr/pickr-themes.scss'])
@endif
<!-- Core CSS -->
@vite([
'resources/assets/vendor/scss/core.scss',
'resources/assets/css/demo.css',
'resources/assets/vendor/scss/pages/front-page.scss'
])
<!-- Page Styles -->
@yield('page-style')
This file includes helpers, customization, config js along with templateCustomizer initialization script :
You can find this file at layouts/sections/scriptsIncludesFront.blade.php
@php
use Illuminate\Support\Facades\Vite;
// Get primary color - first from cookie, then from config
$primaryColor = isset($_COOKIE['front-primaryColor']) ? $_COOKIE['front-primaryColor'] : $configData['color'] ?? null;
@endphp
<!-- laravel style -->
@vite(['resources/assets/vendor/js/helpers.js'])
<!-- beautify ignore:start -->
@if ($configData['hasCustomizer'])
<!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
<!--? Template customizer: To hide customizer set displayCustomizer value false in config.js. -->
@vite(['resources/assets/vendor/js/template-customizer.js'])
@endif
<!--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
@vite(['resources/assets/js/front-config.js'])
@if ($configData['hasCustomizer'])
<script type="module">
document.addEventListener('DOMContentLoaded', function() {
// Initialize template customizer after DOM is loaded
if (window.TemplateCustomizer) {
try {
window.templateCustomizer = new TemplateCustomizer({
defaultTextDir: " {{ $configData['textDirection'] }} ",
@if ($primaryColor)
defaultPrimaryColor: " {{ $primaryColor }} ",
@endif
defaultTheme: " {{ $configData['themeOpt'] }} ",
defaultShowDropdownOnHover: " {{ $configData['showDropdownOnHover'] }} ",
displayCustomizer: " {{ $configData['displayCustomizer'] }} ",
lang: ' {{ app()->getLocale() }} ',
'controls': <?php echo json_encode(['color', 'theme', 'rtl']); ?>,
});
// Ensure color is applied on page load
@if ($primaryColor)
if (window.Helpers && typeof window.Helpers.setColor === 'function') {
window.Helpers.setColor(" {{ $primaryColor }} ", true);
}
@endif
} catch (error) {
console.warn('Template customizer initialization error:', error);
}
}
});
</script>
@endif
This file includes main js along with template related vendor scripts :
You can find this file at layouts/sections/scriptsFront.blade.php
<!-- BEGIN: Vendor JS-->
@vite([
'resources/assets/vendor/js/dropdown-hover.js',
'resources/assets/vendor/js/mega-dropdown.js',
'resources/assets/vendor/libs/popper/popper.js',
'resources/assets/vendor/js/bootstrap.js'
])
@if ($configData['hasCustomizer'])
@vite(['resources/assets/vendor/libs/pickr/pickr.js'])
@endif
@yield('vendor-script')
<!-- END: Page Vendor JS-->
<!-- BEGIN: Theme JS-->
@vite(['resources/assets/js/front-main.js'])
<!-- END: Theme JS-->
<!-- Pricing Modal JS-->
@stack('pricing-script')
<!-- END: Pricing Modal JS-->
<!-- BEGIN: Page JS-->
@yield('page-script')
<!-- END: Page JS-->
Sneat provides two configuration options for RTL.
To use template default RTL Layout, you need to update custom.php
file's myRTLMode
option.
If you want to set default layout to RTL, you can set this option to true
return [
'custom' => [
...
'myRTLMode' => true,
...
],
];
You can configure the initial layout by setting control classes to the <html>
element.
Find all the layout classes with it's description below :
Class | Description |
---|---|
layout-menu-collapsed |
Set layout collapsed for vertical menu |
layout-menu-fixed |
Set layout menu fixed |
layout-navbar-fixed |
Set layout navbar position to fixed |
layout-footer-fixed |
Set layout footer position to fixed |