Skip to content

Commit

Permalink
add view slots
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Sep 30, 2023
1 parent a071580 commit 12291fe
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 7 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"aliases": {
"Tomato": "TomatoPHP\\TomatoAdmin\\Facades\\Tomato",
"TomatoMenu": "TomatoPHP\\TomatoAdmin\\Facades\\TomatoMenu",
"TomatoWidget": "TomatoPHP\\TomatoAdmin\\Facades\\TomatoWidget"
"TomatoWidget": "TomatoPHP\\TomatoAdmin\\Facades\\TomatoWidget",
"TomatoSlot": "TomatoPHP\\TomatoAdmin\\Facades\\TomatoSlot"
}
}
},
Expand Down
28 changes: 24 additions & 4 deletions resources/views/layouts/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,41 @@ class="
<x-tomato-admin-navbar />

<div class="filament-main-content flex-1 w-full px-4 mx-auto md:px-6 lg:px-8">
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getLayoutTop() as $item)
@include($item)
@endforeach
<header
class="mb-4 items-start justify-between space-y-2 filament-header sm:flex sm:space-y-0 sm:space-v-4 sm:rtl:space-v-reverse sm:py-4">
<h1 class="text-2xl font-bold tracking-tight md:text-3xl filament-header-heading">
{{ $header ?? '' }}
</h1>

<div>
<h1 class="text-2xl font-bold tracking-tight md:text-3xl filament-header-heading">
{{ $header ?? '' }}
</h1>

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getLayoutTitle() as $item)
@include($item)
@endforeach
</div>

<div class="flex jusitifiy-start gap-4">
{{ $buttons ?? '' }}

<div>
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getLayoutButtons() as $item)
@include($item)
@endforeach
</div>
</div>
</header>

<!-- SLOT -->
{{$slot}}

</div>

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getLayoutBottom() as $item)
@include($item)
@endforeach

<!-- Footer -->
<x-tomato-admin-footer />
</div>
Expand Down
4 changes: 3 additions & 1 deletion resources/views/layouts/includes/footer.blade.php
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<?php
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getFooter() as $item)
@include($item)
@endforeach
6 changes: 6 additions & 0 deletions resources/views/layouts/includes/menu.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getSidebarTop() as $item)
@include($item)
@endforeach
<div>
<ul class="mx-3 mt-2 space-y-1 text-sm">
<li class="filament-sidebar-item ">
Expand Down Expand Up @@ -125,3 +128,6 @@ class="inline-flex items-center justify-center ml-auto rtl:ml-0 rtl:mr-auto min-
@endforeach
@endif

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getSidebarBottom() as $item)
@include($item)
@endforeach
13 changes: 12 additions & 1 deletion resources/views/layouts/includes/nav.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ class="relative lg:absolute visible lg:invisible"
<div class="flex items-center justify-between flex-1">

<!-- breadcrumbs -->
<div class="flex-1"></div>
<div class="flex-1">
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getNavLeftSide() as $item)
@include($item)
@endforeach
</div>

<!-- Search -->
<div class="filament-global-search flex items-center ml-4">
Expand Down Expand Up @@ -138,8 +142,15 @@ class="filament-icon-button flex items-center justify-center rounded-full relati
<div></div>
</div>
@endif
@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getNavBeforeUserDropdown() as $item)
@include($item)
@endforeach

<x-tomato-admin-profile-dropdown />

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getNavAfterUserDropdown() as $item)
@include($item)
@endforeach
</div>
</div>
</header>
7 changes: 7 additions & 0 deletions resources/views/pages/dashboard.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{{trans('tomato-admin::global.dashboard')}}
</x-slot>

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getDashboardTop() as $item)
@include($item)
@endforeach
<!-- Dashboard Widgets -->
<div class="grid grid-cols-1 gap-4 mb-6 filament-widgets-container md:grid-cols-2 lg:grid-cols-2 lg:gap-8">
@php
Expand Down Expand Up @@ -47,6 +50,10 @@ class="text-gray-600 hover:text-primary-500 focus:outline-none focus:underline d
</div>
@endif
</div>

@foreach(\TomatoPHP\TomatoAdmin\Facade\TomatoSlot::getDashboardBottom() as $item)
@include($item)
@endforeach
</div>
</div>
</x-tomato-admin-layout>
44 changes: 44 additions & 0 deletions src/Facade/TomatoSlot.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace TomatoPHP\TomatoAdmin\Facade;

use Illuminate\Support\Facades\Facade;
use TomatoPHP\TomatoAdmin\Views\Widget;

/**
* @method static navAfterUserDropdown(string $navAfterUserDropdown)
* @method static navBeforeUserDropdown(string $navBeforeUserDropdown)
* @method static navLeftSide(string $navLeftSide)
* @method static sidebarTop(string $sidebarTop)
* @method static sidebarBottom(string $sidebarBottom)
* @method static footer(string $footer)
* @method static dashboardBottom(string $dashboardBottom)
* @method static dashboardTop(string $dashboardTop)
* @method static layoutButtons(string $layoutButtons)
* @method static layoutTitle(string $layoutTitle)
* @method static layoutTop(string $layoutTop)
* @method static layoutBottom(string $layoutBottom)
* @method static layoutButtoms(string $layoutButtoms)
* @method static logoSection(string $logoSection)
* @method array getNavAfterUserDropdown()
* @method array getNavBeforeUserDropdown()
* @method array getNavLeftSide()
* @method array getSidebarTop()
* @method array getSidebarBottom()
* @method array getFooter()
* @method array getDashboardDown()
* @method array getDashboardTop()
* @method array getLayoutButtons()
* @method array getLayoutBottom()
* @method array getLayoutTitle()
* @method array getLayoutTop()
* @method array getDashboardBottom()
* @method array getLogoSection()
*/
class TomatoSlot extends Facade
{
protected static function getFacadeAccessor()
{
return 'tomato-slot';
}
}
Loading

0 comments on commit 12291fe

Please sign in to comment.