Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/faustoq/laravel-model-encrypt-fields

Simple crypt / decrypt for Laravel eloquent models fields
https://github.com/faustoq/laravel-model-encrypt-fields

eloquent encryption-decryption laravel

Last synced: about 1 month ago
JSON representation

Simple crypt / decrypt for Laravel eloquent models fields

Awesome Lists containing this project

README

        

# Laravel Model Encrypt Fields

Encrypt and decrypt Laravel model fields

## Installation

```
composer require faustoq/laravel-model-encrypt-fields
```

Note: The package will be autoregistered thanks to the Laravel Package Auto-Discovery.

Publish the configuration file:

```
php artisan vendor:publish --provider="ModelEncryptFields\ServiceProvider"
```

## Usage

```php
name = "John Doe";
$user->save();
```

Auto-Decrypt the field `name`:

```
echo "Hello, " . $user->name;
```