Search

Laravel Helper Function: decrypt

November 20, 2016 —John Koster

decrypt($value)

The decrypt helper function can be used to decrypt a given $value. The function resolves the configured Illuminate\Contracts\Encryption\Encrypter implementation from the Service Container and then calls the decrypt method on the Encrypter instance.

Assuming a variable $encryptedValue exists and contains a previously encrypted value the following examples are all equivalent:

1<?php
2 
3use Illuminate\Support\Facades\Crypt;
4 
5$encryptedValue = '...';
6 
7// Encrypt using the Crypt facade:
8Crypt::decrypt($encryptedValue);
9 
10// Encrypt using the encrypt helper:
11decrypt($encryptedValue);

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.