diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 648a70a..61aadab 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -34,7 +34,8 @@ class UserController extends Controller $user->active = true; $user->password = Hash::make($request->password); $user->customer_id = Customer::create(['email' => - $request->email], 'name' => $request->name, 'metadata' => ['user_id' => $user->id])->id; + $request->email, 'name' => $request->name, 'metadata' => ['user_id' + => $user->id]])->id; $user->save(); event(new Registered($user)); @@ -91,7 +92,6 @@ class UserController extends Controller //It should have an orderBy clause to make sure the most recent are first //This should limit non pending orders to 50. Should also return a json of all services public function getOrders(Request $request) { - /* Log::debug(Auth::user()->orders()->service_name); */ return Auth::user()->orders()->with('service')->withCasts(['updated_at' => 'datetime:d-m-Y'])->latest()->get(); } @@ -123,6 +123,7 @@ class UserController extends Controller public function resetEmail(Request $request) { Stripe::setApiKey(env('STRIPE_SECRET')); + if (! $request->hasValidSignature()) { abort(401); } diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 8f263a9..eae54c0 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -20,7 +20,8 @@ class CreateUsersTable extends Migration $table->string('customer_id')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); - $table->string('role'); + $table->enum('role', ['client', 'guest', 'admin']); + $table->string('payment_method'); $table->boolean('active')->default(true); $table->unsignedBigInteger('credits')->default(0); $table->rememberToken(); diff --git a/resources/js/panel/edit-cards.vue b/resources/js/panel/edit-cards.vue new file mode 100644 index 0000000..a156a7f --- /dev/null +++ b/resources/js/panel/edit-cards.vue @@ -0,0 +1,87 @@ + + + diff --git a/resources/js/panel/settings.vue b/resources/js/panel/settings.vue index 60fcf02..81668f9 100644 --- a/resources/js/panel/settings.vue +++ b/resources/js/panel/settings.vue @@ -1,8 +1,11 @@