Bagmaz
1 year ago
130
16
Laravel

Validate encrypted

Posted 1 year ago by Bagmaz

How can i validate encrypted unique data?

Table

$table->string('example')->unique();

Validation

$input = $request->validate([
            'example' => 'required|string|unique:examples',
        ]);

Store

$example = new Example;
$example->example = encrypt($input['example']);
$example->save();

Please sign in or create an account to participate in this conversation.