PHPackages                             cwsps154/app-settings - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cwsps154/app-settings

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cwsps154/app-settings
=====================

Package for saving app settings

v1.0.0(1y ago)93.1k↑171.4%1[5 issues](https://github.com/CWSPS154/app-settings/issues)MITPHPPHP ^8.2

Since Mar 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/CWSPS154/app-settings)[ Packagist](https://packagist.org/packages/cwsps154/app-settings)[ RSS](/packages/cwsps154-app-settings/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Filament App Settings
=====================

[](#filament-app-settings)

[![Logo](screenshorts/code-with-sps-154-app-settings.jpg)](screenshorts/code-with-sps-154-app-settings.jpg)

This package will help you to build settings panel with custom forms, which supports all Filament forms components.

Installation
------------

[](#installation)

Install Using Composer

```
composer require cwsps154/app-settings
```

Run

```
php artisan app-settings:install
```

Usage/Examples
--------------

[](#usageexamples)

Add this into your Filament `PannelProvider` class `panel()`

```
use CWSPS154\UsersRolesPermissions\AppSettingsPlugin;

$panel->plugins([AppSettingsPlugin::make()]);
```

You will get some customization on this

```
use CWSPS154\UsersRolesPermissions\AppSettingsPlugin;

AppSettingsPlugin::make()
    ->canAccess(function () {
        return true;
    })
    ->canAccessAppSectionTab(function () {
        return true;
    })
    ->appAdditionalField([])
```

Here using `canAccess()` method you can prevent the view and edit access to the page and using `appAdditionalField()` method you can add additional sections to the default app tab which will available after you install this plugin. Also, you can restrict access to the app section using `canAccessAppSectionTab()`

If you are using `cwsps154/users-roles-permissions` plugin you can use like this

```
use CWSPS154\AppSettings\Models\AppSettings;
use CWSPS154\UsersRolesPermissions\AppSettingsPlugin;
use CWSPS154\UsersRolesPermissions\UsersRolesPermissionsServiceProvider;

AppSettingsPlugin::make()
    ->canAccess(
        UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE,
        AppSettings::VIEW_EDIT_SETTINGS
    )->canAccessAppSectionTab(
        UsersRolesPermissionsServiceProvider::HAVE_ACCESS_GATE,
        AppSettings::APP_SECTION_SETTINGS
    ),
```

Run this command to set up the plugin

```
php artisan filament:assets
```

```
php artisan vendor:publish --tag=app-settings-config
```

which contains these settings

```
return [
    'settings-page' => \CWSPS154\AppSettings\Page\AppSettings::class
];
```

You can create a new tab to these settings using `php artisan make:app-settings-tab` command, which will create a class inside `app/Filament/Settings/Forms` folder.

Sometimes the newly created tab will not automatically show in the page, then please run this

```
composer dumpautoload
```

```
