aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Http
diff options
context:
space:
mode:
Diffstat (limited to 'app/Http')
-rw-r--r--app/Http/Controllers/PublicKeyController.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/Http/Controllers/PublicKeyController.php b/app/Http/Controllers/PublicKeyController.php
new file mode 100644
index 0000000..4fbdd64
--- /dev/null
+++ b/app/Http/Controllers/PublicKeyController.php
@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Http\Controllers;
+
+use Illuminate\Support\Facades\DB;
+
+class PublicKeyController extends Controller
+{
+ public function getUsersKey($user_id)
+ {
+ $public_key = DB::table('public_keys')
+ ->where('user_id', $user_id)
+ ->value('key');
+ // TODO: Friends: do not allow to request every public key
+ return $public_key ? $public_key : abort(404);
+ }
+}