By John Koster
encrypt($value)
The encrypt
helper function can be used to encrypt a given $value
. The function resolves the configured Illuminate\Contracts\Encryption\Encrypter
implementation from the Service Container and then calls the encrypt
method on the Encrypter
instance.
The following examples are all equivalent:
1<?php
2
3use Illuminate\Support\Facades\Crypt;
4
5// Encrypt using the Crypt facade:
6Crypt::encrypt('Hello, Universe');
7
8// Encrypt using the encrypt helper:
9encrypt('Hello, Universe');
∎