diff --git a/compass/app/Http/Controllers/Controller.php b/compass/app/Http/Controllers/Controller.php index 226090b..dff6b3a 100644 --- a/compass/app/Http/Controllers/Controller.php +++ b/compass/app/Http/Controllers/Controller.php @@ -130,7 +130,7 @@ class Controller extends BaseController ->first(); if(!$db) return redirect('/'); - + if($request->input('remove_user')) { $user = DB::table('users')->where('url','=',$request->input('remove_user'))->first(); @@ -164,6 +164,14 @@ class Controller extends BaseController ]); } + return redirect('/settings/'.$db->name); + } else if($request->input('micropub_endpoint')) { + DB::table('databases')->where('id', $db->id) + ->update([ + 'micropub_endpoint' => $request->input('micropub_endpoint'), + 'micropub_token' => $request->input('micropub_token'), + ]); + return redirect('/settings/'.$db->name); } } diff --git a/compass/database/migrations/2015_12_28_221004_micropub.php b/compass/database/migrations/2015_12_28_221004_micropub.php new file mode 100644 index 0000000..be4ee54 --- /dev/null +++ b/compass/database/migrations/2015_12_28_221004_micropub.php @@ -0,0 +1,30 @@ +string('micropub_endpoint', 255); + $table->string('micropub_token', 1024); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +} diff --git a/compass/resources/views/settings.blade.php b/compass/resources/views/settings.blade.php index da14354..25e7d06 100644 --- a/compass/resources/views/settings.blade.php +++ b/compass/resources/views/settings.blade.php @@ -6,6 +6,8 @@
+

Database

+

Read Token

{{ $database->read_token }}
@@ -46,6 +48,26 @@
+

+ +

Micropub Export

+ +

Enter a Micropub endpoint and token below and any trips that are written to this database will be sent to the endpoint as well.

+ +
+
+
+ + + + + + + +
+
+
+