daljo25
WhatsaApp Editor
Hello, I have created a wa.me link generator in my filament app with a custom page, it works with a selector for the numbers calendar and a text area for the message, I want to be able to put the Whatsapp text styles that are similar to markdown but they are not the same, so I thought to create a WhatsappEditor class that extends from markdown editor but it gives me error, to see if any of you can help me solve it or if you have a long time to vreate that plugin
<?php
namespace App\Filament\Forms\Components;
use Filament\Forms\Components\MarkdownEditor;
class WhatsAppEditor extends MarkdownEditor
{
protected $toolbarButtons = [];
public function construct(string $name = null)
{
parent::construct($name);
$this->toolbarButtons = [
'bold' => ['', 'texto*'], // Negrita específica para WhatsApp
'italic' => ['_', 'texto'], // Cursiva específica para WhatsApp
'strikethrough' => ['~', '~texto~'], // Tachado específico para WhatsApp
'code' => ['
', '
texto``'], // Monoespaciado específico para WhatsApp
];
}
public function toolbarButtons(): array
{
return $this->toolbarButtons;
}
}2 replies
error when loading data from a relationship in a select element
I want to load the names of the volunteer table in a select of the beneficiary resource but it gives me the following error
Filament\Support\Services\RelationshipJoiner::prepareQueryForNoConstraints(): Argument #1 ($relationship) must be of type Illuminate\Database\Eloquent\Relations\Relation, null given, called in C:\Users\daljo\dev\Caritas\vendor\filament\forms\src\Components\Select.php on line 773
code of resource
Forms\Components\Select::make('Volunteers_id')
->required()
->relationship('Volunteers', 'name')
->searchable()
->preload(),
model beneficiaries
public function volunteer(): BelongsTo
{
return $this->belongsTo(Volunteers::class);
}
model volunteers
public function beneficiaries() : HasMany
{
return $this->hasMany(Beneficiaries::class);
}
In advance, sorry for my bad English and if it is not well written, the post is my first time.2 replies