Skip to content

feat: configurable brand name defaulting to the application name - #95

Open
mikehins-fliip wants to merge 1 commit into
sunchayn:basefrom
mikehins-fliip:feat/app-name
Open

mikehins-fliip wants to merge 1 commit into
sunchayn:basefrom
mikehins-fliip:feat/app-name

Conversation

@mikehins-fliip

Copy link
Copy Markdown

Summary

The route-explorer brand heading was hardcoded to "Nimbus". This makes it configurable and defaults it to the host application's name, so the playground is badged with the app it runs in.

What is included

  • A nimbus.app_name config value. When null it falls back to config('app.name'), so out of the box the heading shows the application name.
  • The value is injected via window.Nimbus.appName and exposed through useConfigStore.
  • RouteExplorerBranding renders the configured name.

Notes

  • Non-breaking. With no configuration the heading shows the application name, and an explicit nimbus.app_name overrides it.
  • Config stays env-free (matches the existing convention and larastan.noEnvCallsOutsideOfConfig): app_name defaults to null and resolves in the view.
  • resources/dist is rebuilt and committed.

Tests

  • PHP: NimbusIndexTest covers the injected name and the fallback to the application name.
  • JS: RouteExplorerBranding renders the configured name and useConfigStore reads it.
  • Full suites, PHPStan, Rector (dry-run), Pint and type:check pass locally.

The route-explorer brand heading was hardcoded to "Nimbus". It now reads
nimbus.app_name, which falls back to config('app.name') when null so the
playground is badged with the host application.

- injected via window.Nimbus.appName and exposed through useConfigStore
- RouteExplorerBranding renders the configured name

Config stays env-free (larastan): app_name defaults to null and resolves in
the view.

Tests: app-name injection and fallback (backend), plus the branding component
and config store (frontend).
Comment thread config/nimbus.php
Comment on lines +27 to +30
*/

'app_name' => null,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add this to the user-guide wiki as well?

);

$config = \Illuminate\Support\Js::from([
'appName' => config('nimbus.app_name') ?: config('app.name', 'Nimbus'),

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's fall back to Nimbus instead of the app name by default. It is standard to show the product name. Also, this adds a bit of visibility to the package by default.

So basically, giving the user an opt-in option to customize the branding.

Suggested change
'appName' => config('nimbus.app_name') ?: config('app.name', 'Nimbus'),
'appName' => config('nimbus.app_name', 'Nimbus'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants