PHPackages                             alagaccia/laravel-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. alagaccia/laravel-settings

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

alagaccia/laravel-settings
==========================

A Laravel package for managing application settings with a configurable database table

v1.5(5mo ago)07MITPHPPHP ^7.4 || ^8.0

Since Dec 11Pushed 5mo agoCompare

[ Source](https://github.com/alagaccia/laravel-settings)[ Packagist](https://packagist.org/packages/alagaccia/laravel-settings)[ RSS](/packages/alagaccia-laravel-settings/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

Laravel Settings Package
========================

[](#laravel-settings-package)

A Laravel package for managing application settings with a configurable database table.

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

[](#installation)

Install the package via Composer:

```
composer require alagaccia/laravel-settings
```

The service provider will be automatically registered.

Configuration
-------------

[](#configuration)

Publish the configuration file:

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

This will create a `config/laravel-settings.php` file where you can customize the table name:

```
return [
    'table_name' => env('SETTINGS_TABLE_NAME', 'settings'),
];
```

Migration
---------

[](#migration)

Publish the migration file:

```
php artisan vendor:publish --tag=laravel-settings-migrations
```

Then run the migration:

```
php artisan migrate
```

This will create a table (default name: `settings`) with the following structure:

- `id` - Auto-increment bigint primary key
- `category` - String(255) with index
- `label` - String(255)
- `code` - String(255) with unique index
- `value` - Long text
- `created_at` - Timestamp
- `updated_at` - Timestamp

Usage
-----

[](#usage)

### Using the Model

[](#using-the-model)

```
use Alagaccia\LaravelSettings\Models\Setting;

// Create a setting
Setting::create([
    'category' => 'general',
    'label' => 'Site Name',
    'code' => 'site_name',
    'value' => 'My Awesome Site'
]);

// Get a setting by code
$siteName = Setting::getByCode('site_name');

// Get a setting with a default value
$theme = Setting::getByCode('theme', 'default');

// Set or update a setting
Setting::setByCode('site_name', 'New Site Name', 'general', 'Site Name');

// Get all settings in a category
$generalSettings = Setting::getByCategory('general');
```

### Using Helper Functions

[](#using-helper-functions)

The package provides convenient global helper functions:

```
// Get a setting value
$siteName = getSetting('site_name');

// Get with default value
$theme = getSetting('theme', 'light');

// Set a setting
setSetting('site_name', 'New Site Name', 'general', 'Site Name');
```

### Customizing the Table Name

[](#customizing-the-table-name)

You can customize the table name in the config file or via environment variable:

```
SETTINGS_TABLE_NAME=app_settings
```

License
-------

[](#license)

MIT

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance73

Regular maintenance activity

Popularity4

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

151d ago

PHP version history (3 changes)v1.0PHP ^7.4|^8.0

v1.1PHP ^7.4|^8.0|^8.1|^8.2|^8.3

v1.2PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/217d7c3137783151ef5f576207daea5fe5a3b522f9a3a04b5ac590217665a2ac?d=identicon)[alagaccia](/maintainers/alagaccia)

### Embed Badge

![Health badge](/badges/alagaccia-laravel-settings/health.svg)

```
[![Health](https://phpackages.com/badges/alagaccia-laravel-settings/health.svg)](https://phpackages.com/packages/alagaccia-laravel-settings)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[kirschbaum-development/commentions

A package to allow you to create comments, tag users and more

12369.2k](/packages/kirschbaum-development-commentions)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[glhd/special

1929.4k](/packages/glhd-special)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
