Download the PHP package 3neti/laravel-model-input without Composer
On this page you can find all versions of the php package 3neti/laravel-model-input. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3neti/laravel-model-input
More information about 3neti/laravel-model-input
Files in 3neti/laravel-model-input
Package laravel-model-input
Short Description A package to enable assigning inputs to Eloquent Models
License proprietary
Informations about the package laravel-model-input
3neti/laravel-model-input
A Laravel package that enables dynamic, validated inputs attached to Eloquent models.
Features:
- attach arbitrary named inputs to any model (polymorphic)
- enforce validation rules per input type (via enum-driven rules)
- normalize mobile numbers (via laravel-phone)
- dynamic getters/setters via magic accessors
- query models by input (e.g., find by mobile)
- DTO support for structured responses
This package serves as a flexible input layer within the x-change ecosystem.
โจ Core Concept
Instead of adding many columns to a model, you can attach typed inputs:
- mobile
- signature
- address
- bank_account
- etc.
Each input:
- is stored in a separate
inputstable - is validated using rules defined per input type
- can be accessed like a normal attribute
๐ฆ Installation
The current release supports Laravel 12 and 13 on PHP 8.3 and 8.4.
โ๏ธ Configuration
Publish config (optional):
๐งฑ Database Migrations
This package uses:
Run:
๐ง Usage
Add trait to your model
Set input
or using enum:
Force set (skip validation)
Access input like attribute
Validate input
Query by input
Supports:
- normalized matching
- partial matching
- flexible formats
Direct access
๐ฑ Mobile Normalization
Mobile inputs are automatically normalized to:
Examples:
- 0917xxxxxxx
- +63917xxxxxxx
- 63917xxxxxxx
All resolve to the same stored value.
๐งฉ Input Types
Defined via enum:
Each input type has validation rules defined in config:
๐งพ Schema
๐งฑ Traits
HasInputsโ core functionality- dynamic getters/setters
- validation and normalization
๐งช Testing
- Testbench
- SQLite in-memory
- test-only migrations under
tests/database/migrations
๐งญ Architecture Role
In x-change ecosystem:
- contact โ identity
- model-input โ dynamic attributes layer
- cash โ value
- voucher โ instruction
- wallet โ ledger
๐ Design Principles
- avoid schema explosion
- strongly typed inputs via enum
- validation-first design
- flexible querying
- normalization of sensitive fields (e.g., mobile)
๐ Future Enhancements
- input history versioning
- encryption support
- indexing optimizations
- event hooks
๐งพ License
Proprietary
All versions of laravel-model-input with dependencies
illuminate/database Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/validation Version ^12.0 || ^13.0
propaganistas/laravel-phone Version ^6.0
spatie/laravel-data Version ^4.17