/
WebsiteSupport

DocsDeveloper guideBuild an add-on

A settings page

Give your add-on its own settings screen under its own URL, and store small values as configuration parameters.

1 min read

  1. Add a GET route for the page and a PUT route to save it (Hello Notes: /hello/settings).
  2. Read and write values with ConfigParameter::get($key, $default) and ConfigParameter::set($key, $value) (app/Models/ConfigParameter.php:43, :60). Prefix keys with your slug.
  3. Put the page in your menu under a Configuration group, and gate it with your manage ability.

Larger add-ons keep their settings on their own screens too: Employees at /employees/config/settings, Planning at /planning/settings (their routes.php).

See also