Skip to content

Introduce ToolbarButton enum#19517

Closed
ericmp33 wants to merge 3 commits intofilamentphp:4.xfrom
ericmp33:4.x
Closed

Introduce ToolbarButton enum#19517
ericmp33 wants to merge 3 commits intofilamentphp:4.xfrom
ericmp33:4.x

Conversation

@ericmp33
Copy link
Copy Markdown
Contributor

@ericmp33 ericmp33 commented Mar 16, 2026

Description

It adds the ability to use enum cases instead of hardcoded strings when working with toolbar buttons:

RichEditor::make('txt')
    ->toolbarButtons([
        [ToolbarButton::Bold, ToolbarButton::Italic, ToolbarButton::Underline],
        [ToolbarButton::AttachFiles],
    ])

Visual changes

-

Functional changes

  • Code style has been fixed by running the composer cs command.
  • Changes have been tested to not break existing functionality.
  • Documentation is up-to-date.

@github-project-automation github-project-automation Bot moved this to Todo in Roadmap Mar 16, 2026
@ericmp33 ericmp33 changed the title Introduce ToolbarButton enum & use of it on InteractsWithToolbarButtons trait Introduce ToolbarButton enum Mar 16, 2026
@ericmp33 ericmp33 marked this pull request as ready for review March 16, 2026 20:39
@ericmp33 ericmp33 marked this pull request as draft March 17, 2026 07:05
@danharrin
Copy link
Copy Markdown
Member

Since custom toolbar buttons are also supported, I don't really see the value in this to be honest aside from a little autocomplete for the default buttons. For custom buttons you would still need a string, so I don't think it's worthwhile to introduce.

@danharrin danharrin closed this Mar 17, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in Roadmap Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants