F
Filament4mo ago
Marc

How to create dynamic properties in macro using php8

I am trying to create dynamic properties using macro but I am getting the following warning from php8:
Creation of dynamic property Filament\Forms\Components\TextInput::$cachedRecord is deprecated in ...
Creation of dynamic property Filament\Forms\Components\TextInput::$cachedRecord is deprecated in ...
Investigating, you have to put AllowDynamicProperties in the class
namespace Filament\Forms\Components;

use \AllowDynamicProperties;

#[AllowDynamicProperties]
class TextInput extends Field ...
{
}
namespace Filament\Forms\Components;

use \AllowDynamicProperties;

#[AllowDynamicProperties]
class TextInput extends Field ...
{
}
But I'm doing the macro because I can't edit the TextInput class, is there a way to do this without having to create a new class that extends TextInput?
0 Replies
No replies yetBe the first to reply to this messageJoin