Ioncube encoder

I'm uising Filament 2, with php 8.1, and I'm trying to encode with ioncube. But my php dies with this code in my resource: Forms\Components\TextInput::make('ip') ->required() ->unique(callback: function (Unique $rule, callable $get) { return $rule ->where('ip', $get('ip')) ->where('username', $get('username')); }, ignoreRecord: true) ->rule('ipv4') ->maxLength(255), specifically in the unique closure. Any idea what can I do? thanks,
10 Replies
Dennis Koch
Dennis Koch8mo ago
But my php dies with this code in my resource:
What does that mean? Any error? I don't know IonCube. Does it work with Laravel/Eloquent?
JoseBravo
JoseBravoOP8mo ago
Yes, it works with Laravel/Eloquent. Everything in the project with Filament is working except that closure. Sadly, it doesn't give any error, php just dies.
awcodes
awcodes8mo ago
What is the actual exception that is thrown? I don’t know anything about IonCube either, but seems weird to me that it would be a specific problem with Filament.
JoseBravo
JoseBravoOP8mo ago
Because IonCube is being loaded as an extension in php (zend_extension), it doesn't throw any exception. The PHP process just dies. I have several Filament Resources and all of them are working good, the only problem that I'm experiencing is in the unique closure of that TextInput.
awcodes
awcodes8mo ago
I’m still failing to see where ioncube is relevant to the php process as it relates to filament.
JoseBravo
JoseBravoOP8mo ago
ioncube is encoding all php code, closures act a bit different because I think that code is being compiled at runtime.
awcodes
awcodes8mo ago
Ok, but php is interpreted at run time. Not sure I understand the difference.
JoseBravo
JoseBravoOP8mo ago
Is there any other way to do that validation without using the closure? ->unique(callback: function (Unique $rule, callable $get) { return $rule ->where('ip', $get('ip')) ->where('username', $get('username')); }, ignoreRecord: true)
awcodes
awcodes8mo ago
You’re using a double unique key, so no, it has to be done that way. Search the help thread it’s been asked before.
JoseBravo
JoseBravoOP7mo ago
This problem is solved now, I had to encode with --allow-reflection-all
Want results from more Discord servers?
Add your server