diff options
author | Marvin Borner | 2018-07-07 00:20:06 +0200 |
---|---|---|
committer | Marvin Borner | 2018-07-07 00:20:06 +0200 |
commit | 60c973ed2a8e58cc7e9d7e6ca69e17f6ec023c32 (patch) | |
tree | bf6ffd3d655e3be3a5d7b18696cacfb107427861 /app/Http | |
parent | efe4b98e6f3d5d63bc2da8110f474d6b7ec122df (diff) |
Began public key "API"
Diffstat (limited to 'app/Http')
-rw-r--r-- | app/Http/Controllers/PublicKeyController.php | 17 |
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); + } +} |