nhwin/settings
| Install | |
|---|---|
composer require nhwin/settings |
|
| Latest Version: | v1.0.1 |
| PHP: | ^8.2 |
| License: | MIT |
| Last Updated: | Dec 16, 2025 |
| Links: | GitHub · Packagist |
Settings – Lightweight settings & content manager for Filament
Requirements
- PHP version supported by your Laravel installation
- Laravel 12
- A database engine with JSON support (MySQL 5.7+, MariaDB 10.2.7+, PostgreSQL, SQLite recent versions)
- Filament 4
- PHP ^8.2
Installation
-
Install the package via Composer:
composer require nhwin/settings -
Publish the assets (Configuration and Migration):
<!-- Publish Configuration --> php artisan vendor:publish --tag=settings-config <!-- Publish Migrations --> php artisan vendor:publish --tag=settings-migrations <!-- Publish Lang --> php artisan vendor:publish --tag=settings-translations <!-- or --> php artisan vendor:publish --provider="Nhwin\Settings\Providers\SettingServiceProvider" -
Run the migration:
php artisan migrateThis command executes the migration file that you just published, creating the
settingstable (or the custom table name you defined in the config file) in your database. Your package is now ready to use!
[!TIP] If you want to use a custom table name instead of
settings, edit the configuration fileconfig/settings.phpbefore running the migration. See the Configuration section for details.
🚀 Getting Started
Get up and running in just a few steps:
-
Generate Your First Settings Page
php artisan make:settings WebsiteThis command creates a new Filament page (e.g., App/Filament/Pages/WebsiteSettings.php). You can repeat this step for more pages as needed.
[!NOTE] The generator will automatically add the “Settings” suffix to the page name for consistency (e.g., WebsiteSettings), but you can use any group name you wish.
-
Define Your Fields
Open the generated page and customize the form() method with your desired fields:
public function form(Form $form): Form { return $form ->components([ TextInput::make('site_name')->label('Site Name'), TextInput::make('contact_email')->label('Contact Email'), Toggle::make('maintenance_mode')->label('Maintenance Mode'), ]) ->statePath('data'); }
[!NOTE] You may use any Filament form fields or layout components - including third-party ones - to build your settings and content pages, giving you full flexibility in how data is structured and edited.
-
Save and Edit Settings from the Admin Panel
You can now edit these settings directly in your Filament admin panel—no extra boilerplate needed.
-
Use Your Settings Anywhere
Retrieve your configuration values easily:
-
In PHP:
$siteName = settings('website.site_name', 'Default Site Name'); -
In Blade:
<h1>{{ settings('website.site_name', 'Default Site Name') }}</h1> <!-- or --> <h1>@settings('website.site_name', 'Default Site Name')</h1>
-
That’s it! 🎉
Define your fields, save from the admin panel, and access your settings anywhere in your Laravel app.