In Laravel Nova, I am trying to save User Feedback Emojis in the Database using its decimal value then display it in the dashboard.
But only the Decimal value is displayed not the Emoji Icon.
Eg. 🦂, 🤡, 💖
Is this possible in Nova? Or does it need to use a Third-party Library?
Here's my code:
public function fields(Request $request) {
return [
Text::make('Name', 'name')->sortable(),
Text::make('Icon', 'icon')->sortable(),
];
}
EDIT:
I am saving the actual characters in the database. I figured out that
&
is changed to &
I already found the answer to my question.
Using php html_entity_decode()
fixed my problem.
public function fields(Request $request) {
return [
Text::make('Name', 'name')->sortable(),
Text::make('Icon', function() {
return html_entity_decode($this->icon);
})->sortable(),
];
}