ba_mbi_07
ba_mbi_07
FFilament
Created by ba_mbi_07 on 11/9/2023 in #❓┊help
reordering is not working if table has uuid primary column
okay
8 replies
FFilament
Created by ba_mbi_07 on 11/9/2023 in #❓┊help
reordering is not working if table has uuid primary column
Schema::create('coaches', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->string('slug')->unique();
$table->uuid('category_id');
$table->foreign('category_id')->references('id')->on('categories');
$table->string('image')->nullable();
$table->longText('description')->nullable();
$table->integer('position')->nullable();
$table->timestamps();
$table->softDeletes();
});
Schema::create('coaches', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('name');
$table->string('slug')->unique();
$table->uuid('category_id');
$table->foreign('category_id')->references('id')->on('categories');
$table->string('image')->nullable();
$table->longText('description')->nullable();
$table->integer('position')->nullable();
$table->timestamps();
$table->softDeletes();
});
this is my migration
8 replies
FFilament
Created by ba_mbi_07 on 11/9/2023 in #❓┊help
reordering is not working if table has uuid primary column
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name')->searchable()
TextColumn::make('slug')
TextColumn::make('category.name')
])
->reorderable('position')
]);
}
public static function table(Table $table): Table
{
return $table
->columns([
TextColumn::make('name')->searchable()
TextColumn::make('slug')
TextColumn::make('category.name')
])
->reorderable('position')
]);
}
8 replies
FFilament
Created by ba_mbi_07 on 9/8/2023 in #❓┊help
Hide default table in list page
one more question the filter we are using in table ..can we also customize our table header action that way...means my action also change with filter
5 replies
FFilament
Created by ba_mbi_07 on 9/8/2023 in #❓┊help
Hide default table in list page
i need in that list page
5 replies
FFilament
Created by ba_mbi_07 on 9/6/2023 in #❓┊help
real time data from database in form builder
if ($sport?->name == "Football") {
$schema[] = Actions::make([
Action::make("add_commentary")->label('Add Commentary')
->form([
Textarea::make('commentary')->label("Add to Commeny for Football Match")
])
->action(function ($data, $record) use ($competitionMatchInsights) {
if (isset($data["commentary"])) {
foreach ($competitionMatchInsights as $matchInsight) {

$newEntry = [ 'event' => "custom commentary",'sentence' => $data["commentary"] ];
$commentaryData = $matchInsight->commentary;
$commentaryData[] = $newEntry;
$matchInsight->update(['commentary' => $commentaryData]);
to_route('filament.admin.resources.match-lists.view', ['record' => $record->id]);
}
}
})
]);


$schema[] = RichEditor::make("football_commentary")
->afterStateHydrated(function ($component) use ($competitionMatchInsights) {
$test = [];
foreach ($competitionMatchInsights as $commentaryEntry) {
foreach (array_reverse($commentaryEntry->commentary) as $commentaryEntryData) {
$commentaryText = "<p>" . $commentaryEntryData["sentence"] . "</p>";
$test[] = $commentaryText;
}
}
return $component->state(implode("", $test));
});
}
if ($sport?->name == "Football") {
$schema[] = Actions::make([
Action::make("add_commentary")->label('Add Commentary')
->form([
Textarea::make('commentary')->label("Add to Commeny for Football Match")
])
->action(function ($data, $record) use ($competitionMatchInsights) {
if (isset($data["commentary"])) {
foreach ($competitionMatchInsights as $matchInsight) {

$newEntry = [ 'event' => "custom commentary",'sentence' => $data["commentary"] ];
$commentaryData = $matchInsight->commentary;
$commentaryData[] = $newEntry;
$matchInsight->update(['commentary' => $commentaryData]);
to_route('filament.admin.resources.match-lists.view', ['record' => $record->id]);
}
}
})
]);


$schema[] = RichEditor::make("football_commentary")
->afterStateHydrated(function ($component) use ($competitionMatchInsights) {
$test = [];
foreach ($competitionMatchInsights as $commentaryEntry) {
foreach (array_reverse($commentaryEntry->commentary) as $commentaryEntryData) {
$commentaryText = "<p>" . $commentaryEntryData["sentence"] . "</p>";
$test[] = $commentaryText;
}
}
return $component->state(implode("", $test));
});
}
7 replies
FFilament
Created by ba_mbi_07 on 9/6/2023 in #❓┊help
real time data from database in form builder
i used this $livewire->refreshFormData(['license_key']); It does not seem working for my case
7 replies
FFilament
Created by ba_mbi_07 on 9/6/2023 in #❓┊help
real time data from database in form builder
I have a tabs inside that I have a rich editor field and a action button ...in action I am opening a modal where I am saving some data which will reflect in rich editor data
7 replies
FFilament
Created by ba_mbi_07 on 8/10/2023 in #❓┊help
Adding condition for reordering
its my featured widget Query
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->where('position', 1);
}
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->where('position', 1);
}
its my list page
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->whereNot('position', 1);
}

public function getReorderColumn(): ?string
{
return 'position';
}
protected function getTableQuery(): Builder
{
return PageHandler::query()->whereNull('parent_id')->whereNot('position', 1);
}

public function getReorderColumn(): ?string
{
return 'position';
}
9 replies
FFilament
Created by ba_mbi_07 on 8/10/2023 in #❓┊help
Adding condition for reordering
Is there any way to fix that
9 replies
FFilament
Created by ba_mbi_07 on 8/10/2023 in #❓┊help
Adding condition for reordering
9 replies
FFilament
Created by ba_mbi_07 on 8/10/2023 in #❓┊help
Adding condition for reordering
i am talking about when i am trying reordering list table as position 1 data is not present list that was becoming position which i dont want
9 replies
FFilament
Created by ba_mbi_07 on 6/16/2023 in #❓┊help
reordering based on condition
I actually added my position 1 data to separate widget now when i am trying to reorder that its not reordering
57 replies
FFilament
Created by ba_mbi_07 on 6/16/2023 in #❓┊help
reordering based on condition
hey i need more help this
57 replies
FFilament
Created by ba_mbi_07 on 7/14/2023 in #❓┊help
Edit profile issue
does not filament provide edit profile page or we need to customize it ??
5 replies
FFilament
Created by ba_mbi_07 on 7/10/2023 in #❓┊help
getting issue in repeater while generating dynamic field
yes they have unique my text field name is field_default_value and tag input field name is field_options
4 replies
FFilament
Created by ba_mbi_07 on 7/10/2023 in #❓┊help
getting issue in repeater while generating dynamic field
this is how i am generating dynamic field
public static function getOptionalFieldsFormSchema($field_type)
{
if (empty($field_type)) {
return [];
}

$createTextInput = function($field) {
return TextInput::make('field_default_value')
->id($field)
->label(strval(__('cranberry-muffin::cranberry-muffin.form.default-value')))
->numeric(fn (Closure $get) => $get('field_type') === 'number');
};
$createTagsInput = function($field) {
return TagsInput::make('field_options')
->id($field)
->label(strval(__('cranberry-muffin::cranberry-muffin.form.field-options')))
->placeholder(strval(__('cranberry-muffin::cranberry-muffin.form.field-options.placeholder')));
};


$fieldHandlers = [
'text' => $createTextInput,
'text_area' => $createTextInput,
'number' => $createTextInput,
'select' => $createTagsInput,
'radio' => $createTagsInput,
];

$schema = [];

if (isset($fieldHandlers[$field_type])) {
$handler = $fieldHandlers[$field_type];
$schema[] = $handler($field_type);
}
return $schema;
}
public static function getOptionalFieldsFormSchema($field_type)
{
if (empty($field_type)) {
return [];
}

$createTextInput = function($field) {
return TextInput::make('field_default_value')
->id($field)
->label(strval(__('cranberry-muffin::cranberry-muffin.form.default-value')))
->numeric(fn (Closure $get) => $get('field_type') === 'number');
};
$createTagsInput = function($field) {
return TagsInput::make('field_options')
->id($field)
->label(strval(__('cranberry-muffin::cranberry-muffin.form.field-options')))
->placeholder(strval(__('cranberry-muffin::cranberry-muffin.form.field-options.placeholder')));
};


$fieldHandlers = [
'text' => $createTextInput,
'text_area' => $createTextInput,
'number' => $createTextInput,
'select' => $createTagsInput,
'radio' => $createTagsInput,
];

$schema = [];

if (isset($fieldHandlers[$field_type])) {
$handler = $fieldHandlers[$field_type];
$schema[] = $handler($field_type);
}
return $schema;
}
4 replies
FFilament
Created by ba_mbi_07 on 7/7/2023 in #❓┊help
TagsInput not displaying
i used $set('field', [])...i kind of worked
5 replies
FFilament
Created by ba_mbi_07 on 7/7/2023 in #❓┊help
TagsInput not displaying
i want to create field dynamically and i have 8 to 9 fields so i returned the field from a function ...or else i would have used hidden or visible...Anyway thanks a lot
5 replies
FFilament
Created by ba_mbi_07 on 7/7/2023 in #❓┊help
Is there any text field where we can take multiple inputs
okay
11 replies