Deploy Ladill QR Plus / deploy (push) Successful in 33s
Route-based subtitle and page titles replace plain app labels in mobile topbars, and the Afia AI button is visible on mobile across topbars and mobile-page-header screens. Co-authored-by: Cursor <cursoragent@cursor.com>
26 lines
646 B
PHP
26 lines
646 B
PHP
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
class MobileTopbar
|
|
{
|
|
public static function resolve(): array
|
|
{
|
|
$config = config('mobile-topbar', []);
|
|
$subtitle = $config['app_name'] ?? 'Ladill';
|
|
$title = $config['default_title'] ?? 'Overview';
|
|
|
|
foreach ($config['patterns'] ?? [] as $pattern => $patternTitle) {
|
|
if (request()->routeIs($pattern)) {
|
|
$title = is_callable($patternTitle) ? $patternTitle() : $patternTitle;
|
|
break;
|
|
}
|
|
}
|
|
|
|
return [
|
|
'mobileTopbarSubtitle' => $subtitle,
|
|
'mobileTopbarTitle' => $title,
|
|
];
|
|
}
|
|
}
|