outer-web / filament-settings

MIT License
22 stars 5 forks source link

i got error on open setting page #2

Closed Srikanth30t closed 7 months ago

Srikanth30t commented 7 months ago

Thanks for you work, but i got this error Typed static property Filament\Pages\BasePage::$view must not be accessed before initialization i am using laravel "laravel/framework": "^10.10", "filament/filament": "3.2", "outerweb/filament-settings": "^1.1"

thank you

SimonBroekaert commented 7 months ago

Hi,

I personally use this package too and have not (yet) had this issue.

Could you show me your created settings page so that I have a bit more context?

Thanks!

Srikanth30t commented 7 months ago

i created this page as our document https://filamentphp.com/plugins/outerweb-settings

App\Filament\Pages\Settings/Settings.php <?php

namespace App\Filament\Pages\Settings;

use Closure; use Filament\Forms\Components\Tabs; use Filament\Forms\Components\TextInput; use Outerweb\FilamentSettings\Filament\Pages\Settings as BaseSettings;

class Settings extends BaseSettings { public function schema(): array|Closure { return [ Tabs::make('Settings') ->schema([ Tabs\Tab::make('General') ->schema([ TextInput::make('general.brand_name') ->required(), ]), Tabs\Tab::make('Seo') ->schema([ TextInput::make('seo.title') ->required(), TextInput::make('seo.description') ->required(), ]), ]), ]; } }

in your document use OuterWeb\FilamentSettings\Filament\FilamentSettings; please replace use Outerweb\FilamentSettings\Filament\Plugins\FilamentSettingsPlugin;

Screenshot 2024-03-18 180618

thank you for your fast reply correct me if I'm wrong.

webmaster254 commented 7 months ago

Hi, I got the same error Typed static property Filament\Pages\BasePage::$view must not be accessed before initialization

SimonBroekaert commented 7 months ago

Hello @Srikanth30t and @webmaster254 ,

I have fixed the problem in the README.md where the wrong use statement was described. (Thank you @Srikanth30t for pointing that out!)

Could you try again based on these changes and let me know if the problem still exists?

If it does, could you send me your FilamentServiceProvider and custom settings page file contents?

Thank you!

Srikanth30t commented 7 months ago

Hi, i done above changes but still get error image FilamentServiceProvider and custom settings page image

Thank you.

SimonBroekaert commented 7 months ago

Hi @Srikanth30t ,

Thank you for your patience in this as I still cannot reproduce it on my end.

I have changed the code in v1.2.0 so that the typed static property $view is now set directly instead of overriding the Filament getView() method. This should in theory fix the error where it is complaining that the code is trying to access the $view property while it is not yet set to a specific value.

Please let me know if it fixes the issue for you.

Thanks!

Srikanth30t commented 7 months ago

Hi @SimonBroekaert,

Thank you for your effort in solving this issue,

I am waiting for your version 1.2.0

Thanks.

SimonBroekaert commented 7 months ago

Hi @Srikanth30t ,

Have you had a chance to test the new version to see if your problem is fixed?

Thanks!

Srikanth30t commented 7 months ago

Hi @SimonBroekaert Thank you so much it's working...