Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 1.14 KB

README.md

File metadata and controls

39 lines (25 loc) · 1.14 KB

Encoded Attributes for eloquent

License Latest Stable Version Total Downloads

🔣 A powerful layer to encode eloquent attributes.

Installation

composer require attla/encoded-attributes

Usage

Add the Attla\EncodedAttributes\HasEncodedAttributes trait to your model.

To automatically turn some attribute into an encoded attribute, add a Encoded or _encoded suffix.

// getting existed attribute
$model->email

// turning an attribute into an encoded attribute
$model->emailEncoded
// or
$model->email_encoded

If you need validate a encoded attribute with rules: exists, unique use the suffix _encoded.

License

This package is licensed under the MIT license © Octha.