Search by

alfasix / alfakit-settings

faizanakbar10

Settings pages for Spatie Laravel Settings in AlfaKit panels.

Package info

github.com/alfasixbh/alfakit-settings

Homepage

Issues

pkg:composer/alfasix/alfakit-settings

Statistics

Installs: 14

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.8 2026-10-21 10:27 UTC

This package is auto-updated.

Last update: 2026-10-22 11:23:26 UTC


README

by Alfa Six

This is a read-only split of the AlfaKit monorepo. Please open issues and pull requests there.

Settings pages for Spatie Laravel Settings in AlfaKit panels. They render in React, Vue and Svelte with AlfaKit's built-in components.

Installation

composer require alfasix/alfakit-settings

Install spatie/laravel-settings and run its migration.

Usage

Generate a page (and the settings class, when it doesn't exist yet):

php artisan make:alfakit-settings-page ManageGeneral GeneralSettings
use AlfaSix\Alfakit\Forms\Components\TextInput;
use AlfaSix\Alfakit\Schemas\Schema;
use AlfaSix\AlfakitSettings\Pages\SettingsPage;

class ManageGeneral extends SettingsPage
{
    protected static string $settings = GeneralSettings::class;

    public function form(Schema $schema): Schema
    {
        return $schema->components([
            TextInput::make('site_name')->required(),
        ]);
    }
}

The form is filled from the settings and the save button writes them back, with mutateFormDataBeforeFill(), mutateFormDataBeforeSave(), beforeSave() / afterSave() hooks, a saved notification and canAccess() authorisation.

Discovered pages work as they are; the plugin registers pages explicitly and can group them:

use AlfaSix\AlfakitSettings\SettingsPlugin;

$panel->plugin(SettingsPlugin::make()->pages([ManageGeneral::class])->navigationGroup('Settings'));

Full documentation: alfakit.dev/docs/plugins/settings.

License

MIT. See LICENSE.md.