igorclauss
igorclauss
FFilament
Created by Adel on 10/19/2024 in #❓┊help
fill form with initial data before show form
You have access to the state on the createResourcePage, also there are lifecycle hooks. But maybe it is still the best to use defaults on field level. It depends on what you want to achieve
9 replies
FFilament
Created by Adel on 10/19/2024 in #❓┊help
fill form with initial data before show form
In which context? Are you in a filament resource or a custom livewire component?
9 replies
FFilament
Created by ocram82 on 9/20/2024 in #❓┊help
Disable view action when click on row
https://filamentphp.com/docs/3.x/tables/advanced "You may allow table rows to be completely clickable by using the $table->recordUrl() method:" When you pass null it won't be clickable anymore.
11 replies
FFilament
Created by igorclauss on 9/11/2024 in #❓┊help
Save record and repeater with all Relationships on add item click
Okay, fair point. I had issues on the edit page. I have the record, a related hasMany Repeater and within a hasMany select. And I want to save the state of all on addItem button click. Can I really just hook into the stateUpdated event for this?
5 replies
FFilament
Created by igorclauss on 9/11/2024 in #❓┊help
Save record and repeater with all Relationships on add item click
Bump
5 replies
FFilament
Created by igorclauss on 9/6/2024 in #❓┊help
TextColumn List with URL on each item
Worked perfectly.
7 replies
FFilament
Created by igorclauss on 9/6/2024 in #❓┊help
TextColumn List with URL on each item
That's awesome, I did not knew that. Thanks
7 replies
FFilament
Created by atabegruslan on 8/27/2024 in #❓┊help
Conditionally add and update relations
In most cases you can pass Closures or Callables to filament methods.
16 replies
FFilament
Created by atabegruslan on 8/23/2024 in #❓┊help
TextInput, set default value (from backend)
Your code should actually do it. But you need to check if the relationships on the model is set.
16 replies
FFilament
Created by Vladimir on 5/25/2024 in #❓┊help
Creating a resource but is not appearing in navigation menu
Also try to run php artisan filament:optimize-clear
7 replies
FFilament
Created by igorclauss on 1/25/2024 in #❓┊help
Persist toggled Columns over Logins
I will start and continue from this point. Thank you very much for the advice.
4 replies
FFilament
Created by Ali on 12/8/2023 in #❓┊help
make:filament-importer is not defined.
When you update today to 3.1.18 it will be fixed.
17 replies
FFilament
Created by Ali on 12/8/2023 in #❓┊help
make:filament-importer is not defined.
Yes, @DrByte already submitted a pull request to fix this.
17 replies
FFilament
Created by Ali on 12/8/2023 in #❓┊help
make:filament-importer is not defined.
Your filament version is below 3.1. The import action was introduced in v 3.1.
17 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
It was merged right next to your solution. Great work and thanks for the inspiration.
25 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
I found this solution:
$csvReader = CsvReader::createFromStream($csvStream);
$delimiter = $this->guessDelimiter($csvReader);
$csvReader->setDelimiter($delimiter);



/**
* @return string
*/
public function guessDelimiter(CsvReader $csvReader, array $set = [], int $limit = 20): string
{
if (empty($set)) {
$set = [';', ',', '|', "\t"];
}

$delimiterCounts = Info::getDelimiterStats($csvReader, $set, $limit);

// get the delimiter by the highest count of appearances
return array_search(max($delimiterCounts), $delimiterCounts);
}
$csvReader = CsvReader::createFromStream($csvStream);
$delimiter = $this->guessDelimiter($csvReader);
$csvReader->setDelimiter($delimiter);



/**
* @return string
*/
public function guessDelimiter(CsvReader $csvReader, array $set = [], int $limit = 20): string
{
if (empty($set)) {
$set = [';', ',', '|', "\t"];
}

$delimiterCounts = Info::getDelimiterStats($csvReader, $set, $limit);

// get the delimiter by the highest count of appearances
return array_search(max($delimiterCounts), $delimiterCounts);
}
25 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
I haven't found the guessing either. But League csv definitely has a method for that, haven't they?
25 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
I thought there must be a way to guess the delimiter. Because we have the csv file...
25 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
But I did it in the trait itself
25 replies
FFilament
Created by igorclauss on 12/4/2023 in #❓┊help
Non comma Separated CSV Import
That's how I fixed it for me.
25 replies