11# laravel-setanjo - Multi-Tenant Laravel Settings Package
22
3- [ ![ Latest Version on Packagist] ( https://img.shields.io/packagist/v/ahs12/laravel-setanjo.svg?style=flat-square )] ( https://packagist.org/packages/ahs12/laravel-setanjo )
4- [ ![ GitHub Tests Action Status] ( https://img.shields.io/github/workflow/status/ahs12/laravel-setanjo/run-tests?label=tests )] ( https://github.com/ahs12/laravel-setanjo/actions?query=workflow%3Arun-tests+branch%3Amain )
5- [ ![ GitHub Code Style Action Status] ( https://img.shields.io/github/workflow/status/ahs12/laravel-setanjo/Fix%20PHP%20code%20style%20issues?label=code%20style )] ( https://github.com/ahs12/laravel-setanjo/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain )
6- [ ![ Total Downloads] ( https://img.shields.io/packagist/dt/ahs12/laravel-setanjo.svg?style=flat-square )] ( https://packagist.org/packages/ahs12/laravel-setanjo )
3+ <p align =" center " >
4+ <a href =" https://github.com/ahs12/laravel-setanjo/actions " ><img src =" https://github.com/ahs12/laravel-setanjo/actions/workflows/run-tests.yml/badge.svg " alt =" Build Status " ></a >
5+ <a href =" https://packagist.org/packages/ahs12/laravel-setanjo " ><img src =" https://img.shields.io/packagist/dt/ahs12/laravel-setanjo " alt =" Total Downloads " ></a >
6+ <a href =" https://packagist.org/packages/ahs12/laravel-setanjo " ><img src =" https://img.shields.io/packagist/v/ahs12/laravel-setanjo " alt =" Latest Stable Version " ></a >
7+ <a href =" https://packagist.org/packages/ahs12/laravel-setanjo " ><img src =" https://img.shields.io/packagist/l/ahs12/laravel-setanjo " alt =" License " ></a >
8+ </p >
79
810A powerful Laravel package for managing application settings with multi-tenant support. Store global settings or tenant-specific configurations with automatic type casting, caching, and a clean API. Perfect for A/B testing, feature flags, and user preferences.
911
@@ -18,6 +20,10 @@ A powerful Laravel package for managing application settings with multi-tenant s
1820- 🧪 ** Fully Tested** : Comprehensive test suite included
1921- ✅ ** Type Safety** : Automatic type detection and conversion
2022
23+ ## Requirements
24+ - PHP 8.2 or higher
25+ - Laravel 10.0 or higher
26+
2127## Installation
2228
23291 . ** Install the package:**
@@ -128,9 +134,16 @@ Settings::set('is_active', true); // Boolean
128134Settings::set('max_users', 100); // Integer
129135Settings::set('rate', 4.99); // Float
130136Settings::set('features', ['api', 'sms']); // Array
137+ Settings::set('config', '{"theme": "dark", "lang": "en"}'); // JSON string
138+ Settings::set('metadata',['version' => '1.0', 'author' => 'John']); // Object
131139
132140// Values are returned with correct types
133141$isActive = Settings::get('is_active'); // Returns boolean true
142+ $maxUsers = Settings::get('max_users'); // Returns integer 100
143+ $rate = Settings::get('rate'); // Returns float 4.99
144+ $features = Settings::get('features'); // Returns array ['api', 'sms']
145+ $config = Settings::get('config'); // Returns array ['theme' => 'dark', 'lang' => 'en']
146+ $metadata = Settings::get('metadata'); // Returns object with version and author properties
134147```
135148
136149## Common Use Cases
@@ -163,17 +176,6 @@ Settings::for($company)->set('user_limit', 50);
163176Settings::for($user)->set('email_notifications', false);
164177```
165178
166- ## Environment Variables
167-
168- You can configure the package using environment variables:
169-
170- ``` env
171- SETANJO_TENANCY_MODE=strict
172- SETANJO_STRICT_TENANT_MODEL="App\Models\User"
173- SETANJO_CACHE_ENABLED=true
174- SETANJO_CACHE_TTL=3600
175- ```
176-
177179## Documentation
178180
179181For detailed documentation, advanced usage, and configuration options, visit our [ documentation site] ( https://github.com/ahs12/laravel-setanjo/wiki ) .
0 commit comments