diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 217ebbb..ac11018 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -6,6 +6,8 @@ use App\Models\QrCode; use App\Policies\QrCodePolicy; use Illuminate\Support\Facades\Gate; use Illuminate\Support\ServiceProvider; +use App\Support\MobileTopbar; +use Illuminate\Support\Facades\View; class AppServiceProvider extends ServiceProvider { @@ -17,5 +19,9 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { Gate::policy(QrCode::class, QrCodePolicy::class); + View::composer(['partials.topbar', 'partials.topbar-qr'], function ($view) { + $view->with(MobileTopbar::resolve()); + }); + } } diff --git a/app/Support/MobileTopbar.php b/app/Support/MobileTopbar.php new file mode 100644 index 0000000..5115afc --- /dev/null +++ b/app/Support/MobileTopbar.php @@ -0,0 +1,25 @@ + $patternTitle) { + if (request()->routeIs($pattern)) { + $title = is_callable($patternTitle) ? $patternTitle() : $patternTitle; + break; + } + } + + return [ + 'mobileTopbarSubtitle' => $subtitle, + 'mobileTopbarTitle' => $title, + ]; + } +} diff --git a/config/mobile-topbar.php b/config/mobile-topbar.php new file mode 100644 index 0000000..94a90dc --- /dev/null +++ b/config/mobile-topbar.php @@ -0,0 +1,19 @@ + 'QR Plus', + 'default_title' => 'Overview', + 'patterns' => [ + 'qr.dashboard' => 'Overview', + 'qr.search' => 'Search', + 'user.qr-codes.index' => 'QR codes', + 'user.qr-codes.create' => 'Create QR code', + 'user.qr-codes.show' => 'QR code', + 'account.wallet' => 'Wallet', + 'account.billing' => 'Billing', + 'account.team*' => 'Team', + 'account.settings' => 'Settings', + 'account.developers*' => 'Developers', + 'notifications.*' => 'Notifications', + ], +]; diff --git a/resources/views/components/mobile-page-header.blade.php b/resources/views/components/mobile-page-header.blade.php index acd3927..dc4aa60 100644 --- a/resources/views/components/mobile-page-header.blade.php +++ b/resources/views/components/mobile-page-header.blade.php @@ -3,6 +3,7 @@ 'subtitle' => null, 'backUrl' => null, 'badge' => null, + 'hideAfia' => false, ])
{{ $subtitle }}
+ @endif +Ladill QR Plus
+ @include('partials.mobile-topbar-title') - @auth - + @include('partials.afia-button', ['compact' => true]) @endauth @include('partials.launcher')