jeph
jeph
FFilament
Created by jeph on 2/9/2024 in #❓┊help
two columns from a single database column
Hello everyone! Before in v2, I can create two columns from a single database column. But now in v3, when I create a second column from the same database column, the first column will be replaced by the 2nd column. Is there a way to make two columns out of the same database column now in v3? Sample code:
TextColumn::make('name')
->formatStateUsing(function ($state) {
$names = explode(' ', $state); // Split the full name into an array
return $names[0]; // First name
})
->label('First Name'),

TextColumn::make('name')
->formatStateUsing(function ($state) {
$names = explode(' ', $state); // Split the full name into an array
return $names[1] ?? ''; // Last name (or empty string if not available)
})
->label('Last Name'),
TextColumn::make('name')
->formatStateUsing(function ($state) {
$names = explode(' ', $state); // Split the full name into an array
return $names[0]; // First name
})
->label('First Name'),

TextColumn::make('name')
->formatStateUsing(function ($state) {
$names = explode(' ', $state); // Split the full name into an array
return $names[1] ?? ''; // Last name (or empty string if not available)
})
->label('Last Name'),
6 replies
FFilament
Created by jeph on 12/20/2023 in #❓┊help
Validation won't work with Form and Table on one component
No description
2 replies
FFilament
Created by jeph on 12/18/2023 in #❓┊help
Validation didn't work
It's a simple ->gt() validation but I can't seem to make it work.. I can't figure out why. Please help. thanks.
Fieldset::make('Domain Length')
->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
->numeric()
->gt('min')
->live(),
])->columnSpan(2),
Fieldset::make('Domain Length')
->schema([
TextInput::make('min')
->numeric()
->live(),
TextInput::make('max')
->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
->numeric()
->gt('min')
->live(),
])->columnSpan(2),
I also tried custome rules but it still wont work.
TextInput::make('max')
->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
->numeric()
->rules([
function () {
return function (GET $get, $value, Closure $fail) {
if ($value > $get('min') {
$fail('The :attribute is invalid.');
}
};
},
])
->live(),
TextInput::make('max')
->hintIcon('heroicon-o-information-circle','Length excluding the extension.')
->numeric()
->rules([
function () {
return function (GET $get, $value, Closure $fail) {
if ($value > $get('min') {
$fail('The :attribute is invalid.');
}
};
},
])
->live(),
9 replies
FFilament
Created by jeph on 9/27/2023 in #❓┊help
Blur the rest of the query result except the first 5
No description
20 replies
FFilament
Created by jeph on 9/18/2023 in #❓┊help
Multiple Select and hint wont work on production
No description
11 replies
FFilament
Created by jeph on 9/18/2023 in #❓┊help
Deploy error on cpanel
I am rebuilding my app using filament v3. Everything works in v2. Now in v3 it wont work anymore. I'm just getting server error 500. To deploy it in cpanel, I just ran npm run build and then uploaded project folder in cpanel, connecting public index.php to /storage/framework/maintenance.php and bootstrap/app.php and connecting .env file to mysql. Am I missing something? or is there any other way of deploying it using cpanel? I did not upgrade filament. I rebuild it using a fresh filament v3, livewire 3, laravel 10, php 8.2. also already upgraded php 8.2 in cpanel.
21 replies