Skip to content

[Settings]: General — Company Information #247

Description

@nielsdrost7

SMART Plan — Set default company name in General Settings

Specific

A TextInput field labelled "Company Name" in the General tab of the Company Settings page. Stores a plain string under the key company_name, scoped to the current company. The value is used as the display name in PDF headers (invoices, quotes).

Measurable

  • The field appears in the General section of the Company Settings page
  • Saving the form persists the value to the settings table with key company_name and company_id scope
  • The value is read back correctly on page reload

Achievable

  1. Create/extend Modules/Core/Filament/Company/Pages/CompanySettings.php (Filament page with tabs)
  2. Add a TextInput::make('company_name')->label('Company Name') field to the General tab section
  3. Add const COMPANY_NAME = 'company_name'; to Modules/Core/Models/Setting.php constants
  4. Register the page in CompanyPanelProvider

Relevant

The company name is the primary branding element on all PDF documents sent to clients. Allowing per-company overrides means each tenant can maintain their own display name without touching system-level config.

Time-bound

Sprint 6.


Arrange · Act · Assert

// Modules/Core/Tests/Feature/CompanySettingsTest.php

#[Test]
public function it_saves_company_name_setting(): void
{
    /* Arrange */
    $page = Livewire::actingAs($this->user)
        ->test(\Modules\Core\Filament\Company\Pages\CompanySettings::class);

    /* Act */
    $page->set('data.company_name', 'Acme Corp')
         ->call('save');

    /* Assert */
    $page->assertSuccessful();
    $this->assertDatabaseHas('settings', [
        'company_id' => $this->company->id,
        'key'        => 'company_name',
        'value'      => 'Acme Corp',
    ]);
}

Activity

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

Metadata

Metadata

Assignees

Labels

refinedRefined with SMART plan / test suggestions

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions