use ESolution\DBEncryption\Traits\EncryptedAttribute;
class User extends Eloquent {
use EncryptedAttribute;
/**
* The attributes that should be encrypted on save.
*
* @var array
*/
protected $encryptable = [
'first_name', 'last_name'
];
}
namespace App\Http\Controllers;
use App\User;
class UsersController extends Controller {
public function index(Request $request)
{
$user = User::whereEncrypted('first_name','john')
->orWhereEncrypted('last_name','!=','Doe')->firstOrFail();
return $user;
}
}