From ee73a60452f0e8b10ad636d45f0867c549511a29 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 16 Jun 2022 16:43:09 +1000 Subject: [PATCH 1/2] Comments for React Application --- resources/views/react/index.blade.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/resources/views/react/index.blade.php b/resources/views/react/index.blade.php index d490313bc3..a70107a22e 100644 --- a/resources/views/react/index.blade.php +++ b/resources/views/react/index.blade.php @@ -17,4 +17,15 @@ + From ce12b181cfeab8967c2dce2be632e153f74f6240 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 16 Jun 2022 16:52:43 +1000 Subject: [PATCH 2/2] Don't allow upgrade to react if it is not installed --- app/Http/Controllers/AccountController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index 161356302f..67d2ffca77 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -163,6 +163,11 @@ class AccountController extends BaseController public function update(UpdateAccountRequest $request, Account $account) { + $fi = new \FilesystemIterator(public_path('react'), \FilesystemIterator::SKIP_DOTS); + + if(iterator_count($fi) < 30) + return response()->json(['message' => 'React App Not Installed, Please install the React app before attempting to switch.'], 400); + $account->fill($request->all()); $account->save();