attla/encoded-attributes

A powerful layer to encode eloquent attributes.

dev-main 2022-08-14 06:40 UTC

This package is auto-updated.

Last update: 2024-11-14 11:18:49 UTC


README

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.