PHPackages                             androlax2/laravel-model-typed-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. androlax2/laravel-model-typed-settings

ActiveLibrary

androlax2/laravel-model-typed-settings
======================================

A Laravel package that adds type-safe settings attributes to Eloquent models with automatic casting and validation

0.1.0(3mo ago)1663↑16.7%[2 PRs](https://github.com/Androlax2/laravel-model-typed-settings/pulls)MITPHPPHP ^8.3CI passing

Since Feb 2Pushed 1mo agoCompare

[ Source](https://github.com/Androlax2/laravel-model-typed-settings)[ Packagist](https://packagist.org/packages/androlax2/laravel-model-typed-settings)[ Docs](https://github.com/androlax2/laravel-model-typed-settings)[ GitHub Sponsors](https://github.com/Androlax2)[ RSS](/packages/androlax2-laravel-model-typed-settings/feed)WikiDiscussions main Synced 1mo ago

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

Laravel Model Typed Settings
============================

[](#laravel-model-typed-settings)

[![Latest Version on Packagist](https://camo.githubusercontent.com/38120be9099c6f9846cced22b18f2c44fae96ea5289140f253972f0b233da608/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616e64726f6c6178322f6c61726176656c2d6d6f64656c2d74797065642d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/androlax2/laravel-model-typed-settings)[![GitHub Tests Action Status](https://camo.githubusercontent.com/f367bfdd44e54b784fc176e7c19af51e6d84c9843332b47329703baa483466e9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616e64726f6c6178322f6c61726176656c2d6d6f64656c2d74797065642d73657474696e67732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/androlax2/laravel-model-typed-settings/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/9c0afce9b02410da7a3724ca3b8f05dc7f9a3fb5dfdd49ac3a499016a5746b38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616e64726f6c6178322f6c61726176656c2d6d6f64656c2d74797065642d73657474696e67732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/androlax2/laravel-model-typed-settings/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/4e43f5e582fb06515a08fd52e50146dabfec5db1a501f8820e37796ef5004c56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616e64726f6c6178322f6c61726176656c2d6d6f64656c2d74797065642d73657474696e67732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/androlax2/laravel-model-typed-settings)

Stop treating your model settings like messy associative arrays. This package allows you to cast JSON columns directly into Type-Safe DTOs with support for nested objects, enums, and automatic type coercion.

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

[](#installation)

You can install the package via composer:

```
composer require androlax2/laravel-model-typed-settings
```

Usage
-----

[](#usage)

### Define your Settings Class

[](#define-your-settings-class)

Create a class that extends `Androlax2\LaravelModelTypedSettings\Settings`. Use standard PHP properties with types and default values.

```
