Created
February 19, 2020 05:57
-
-
Save blood72/4a93556723f48857558ec704d549a1af to your computer and use it in GitHub Desktop.
IsEncrypted.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Illuminate\Support\Facades\Validator; | |
| Validator::extend('encrypted', function ($attribute, $value, $parameters, $validator) { | |
| try { | |
| return decrypt($value); | |
| } catch (\Illuminate\Contracts\Encryption\DecryptException $exception) { | |
| return false; | |
| } | |
| }); |
Author
blood72
commented
Feb 19, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment