如何从laravel + postgres中的表中选择decrypt()

I want to get an encrypted field from a postgre database to be decrypted using select decrypt() in pgsql

I have try

$name = DB::connection('jb_system')->select("select decrypt(name, 'key', 'aes') as names from employee");

I'm use encode inside the raw

 $name = DB::connection('conn_name')->table('employee')->select(DB::connection('conn_name')->raw("encode(decrypt(name, 'key', 'aes'), 'escape')"))->get();

You can use DB::raw

$name = DB::connection('jb_system')->table("employee")
        ->select(DB::raw("decrypt(name, 'key', 'aes') as names"))
        ->get();