refactor: remove console-specific resource registration and enhance OnboardingResource form schema

This commit is contained in:
2025-12-03 22:14:08 -05:00
parent bce5f99817
commit 09c2ca33d7
3 changed files with 7 additions and 13 deletions

View File

@@ -36,8 +36,7 @@ class OnboardingResource extends Resource
public static function form(Form $form): Form
{
return $form
->columns(1)
->components([
->schema([
TextInput::make('title')
->label('Title')
->required()
@@ -85,8 +84,6 @@ class OnboardingResource extends Resource
Select::make('page_route')
->label('Page to Guide To')
->visible(fn (Get $get): bool => $get('is_guided'))
->required(fn (Get $get): bool => $get('is_guided'))
->options([
'dashboard' => 'Dashboard',
'services' => 'Services',
@@ -100,8 +97,11 @@ class OnboardingResource extends Resource
'account.notifications' => 'Notifications',
'products' => 'Browse Products',
])
->helperText('Select which page the user should be guided to'),
]);
->helperText('Select which page the user should be guided to')
->visible(fn (Get $get): bool => $get('is_guided'))
->required(fn (Get $get): bool => $get('is_guided')),
])
->columns(1);
}
public static function table(Table $table): Table

View File

@@ -62,13 +62,6 @@ class Onboarding extends Extension
public function boot()
{
if (app()->runningInConsole() === false) {
\Filament\Facades\Filament::getCurrentPanel()?->resources([
\Paymenter\Extensions\Others\Onboarding\Admin\Resources\OnboardingResource::class,
]);
}
app('view')->addNamespace('onboarding', __DIR__ . '/resources/views');

View File

@@ -1,3 +1,4 @@
@php use Illuminate\Support\Facades\Storage; @endphp
<div>
@if($showModal && count($slides) > 0)
<div x-data="{ open: @entangle('showModal'), currentSlide: @entangle('currentSlide') }"