From c7a3779ad8d56f634f3ec1dd83f4b0d85df54efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Drunen?= Date: Sun, 6 Aug 2023 23:57:21 +0200 Subject: [PATCH] Show currencies on register page --- .../Controllers/Api/CurrencyController.php | 17 +++++++++++++++ app/Http/Resources/CurrencyResource.php | 18 ++++++++++++++++ app/Providers/AppServiceProvider.php | 3 +++ .../assets/js/prototype/screens/Register.vue | 21 +++++++++++++++++-- routes/api.php | 2 +- 5 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 app/Http/Controllers/Api/CurrencyController.php create mode 100644 app/Http/Resources/CurrencyResource.php diff --git a/app/Http/Controllers/Api/CurrencyController.php b/app/Http/Controllers/Api/CurrencyController.php new file mode 100644 index 00000000..c7bb1b13 --- /dev/null +++ b/app/Http/Controllers/Api/CurrencyController.php @@ -0,0 +1,17 @@ + $this->id, + 'name' => $this->name, + 'symbol' => $this->symbol, + ]; + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 726b41ec..630c77dd 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,6 +4,7 @@ use App\Helper; use App\Models\Space; +use Illuminate\Http\Resources\Json\JsonResource; use Illuminate\Support\ServiceProvider; use Auth; @@ -26,6 +27,8 @@ public function boot() 'versionNumber' => $versionNumber ]); }); + + JsonResource::withoutWrapping(); } public function register() diff --git a/resources/assets/js/prototype/screens/Register.vue b/resources/assets/js/prototype/screens/Register.vue index 97d89f4f..e31c986d 100644 --- a/resources/assets/js/prototype/screens/Register.vue +++ b/resources/assets/js/prototype/screens/Register.vue @@ -1,5 +1,18 @@