From 5dc96f57c40e5ac888a4e6226bd44b277b7f18f6 Mon Sep 17 00:00:00 2001 From: Phuc Le Date: Mon, 17 May 2021 22:28:13 -0700 Subject: [PATCH 1/4] Add action --- src/Nova/Actions/CreateGMBAccount.php | 48 +++++++++++++++++++++++++++ src/Nova/GmbAccount.php | 5 +++ 2 files changed, 53 insertions(+) create mode 100644 src/Nova/Actions/CreateGMBAccount.php diff --git a/src/Nova/Actions/CreateGMBAccount.php b/src/Nova/Actions/CreateGMBAccount.php new file mode 100644 index 0000000..5299879 --- /dev/null +++ b/src/Nova/Actions/CreateGMBAccount.php @@ -0,0 +1,48 @@ +setAccessToken($accessToken); + + dd($googleServices->myBusiness()->accounts); + } + + /** + * Get the fields available on the action. + * + * @return array + */ + public function fields() + { + return []; + } +} diff --git a/src/Nova/GmbAccount.php b/src/Nova/GmbAccount.php index 17efb7a..a1e231f 100644 --- a/src/Nova/GmbAccount.php +++ b/src/Nova/GmbAccount.php @@ -9,6 +9,7 @@ use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; use Laravel\Nova\Panel; +use Tipoff\GoogleApi\Nova\Actions\CreateGMBAccount; use Tipoff\Support\Nova\BaseResource; class GmbAccount extends BaseResource @@ -25,6 +26,10 @@ class GmbAccount extends BaseResource public static $group = 'Z - Admin'; + protected array $actionClassList = [ + CreateGMBAccount::class + ]; + public function fieldsForIndex(NovaRequest $request) { return array_filter([ From 22546c0084b0e8b4c6350f398919ecaafcebecc8 Mon Sep 17 00:00:00 2001 From: Phuc Le Date: Wed, 19 May 2021 20:27:13 -0700 Subject: [PATCH 2/4] Fix Key Name is empty in Nova --- src/Nova/Key.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nova/Key.php b/src/Nova/Key.php index dadcf00..ae7bc94 100644 --- a/src/Nova/Key.php +++ b/src/Nova/Key.php @@ -29,14 +29,14 @@ public function fieldsForIndex(NovaRequest $request) { return array_filter([ ID::make()->sortable(), - Text::make('Name')->sortable(), + Text::make('Slug')->sortable(), ]); } public function fields(Request $request) { return array_filter([ - Text::make('Name')->required(), + Text::make('Slug'), new Panel('Data Fields', $this->dataFields()), ]); From 63c069941a8600bd683e02ba46452d392a98fdcd Mon Sep 17 00:00:00 2001 From: phuclh Date: Thu, 20 May 2021 03:27:48 +0000 Subject: [PATCH 3/4] Fix styling --- src/Nova/Actions/CreateGMBAccount.php | 1 - src/Nova/GmbAccount.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Nova/Actions/CreateGMBAccount.php b/src/Nova/Actions/CreateGMBAccount.php index 5299879..17f3f27 100644 --- a/src/Nova/Actions/CreateGMBAccount.php +++ b/src/Nova/Actions/CreateGMBAccount.php @@ -4,7 +4,6 @@ use Illuminate\Bus\Queueable; use Illuminate\Queue\InteractsWithQueue; -use Illuminate\Support\Collection; use Laravel\Nova\Actions\Action; use Laravel\Nova\Fields\ActionFields; use Tipoff\GoogleApi\Facades\GoogleOauth; diff --git a/src/Nova/GmbAccount.php b/src/Nova/GmbAccount.php index a1e231f..1a642c0 100644 --- a/src/Nova/GmbAccount.php +++ b/src/Nova/GmbAccount.php @@ -27,7 +27,7 @@ class GmbAccount extends BaseResource public static $group = 'Z - Admin'; protected array $actionClassList = [ - CreateGMBAccount::class + CreateGMBAccount::class, ]; public function fieldsForIndex(NovaRequest $request) From 180bcfb7def2e7e0ec3469094c3115adf3771578 Mon Sep 17 00:00:00 2001 From: Phuc Le Date: Wed, 19 May 2021 20:30:40 -0700 Subject: [PATCH 4/4] Revert "Add action" This reverts commit 5dc96f57c40e5ac888a4e6226bd44b277b7f18f6. --- src/Nova/Actions/CreateGMBAccount.php | 48 --------------------------- src/Nova/GmbAccount.php | 5 --- 2 files changed, 53 deletions(-) delete mode 100644 src/Nova/Actions/CreateGMBAccount.php diff --git a/src/Nova/Actions/CreateGMBAccount.php b/src/Nova/Actions/CreateGMBAccount.php deleted file mode 100644 index 5299879..0000000 --- a/src/Nova/Actions/CreateGMBAccount.php +++ /dev/null @@ -1,48 +0,0 @@ -setAccessToken($accessToken); - - dd($googleServices->myBusiness()->accounts); - } - - /** - * Get the fields available on the action. - * - * @return array - */ - public function fields() - { - return []; - } -} diff --git a/src/Nova/GmbAccount.php b/src/Nova/GmbAccount.php index a1e231f..17efb7a 100644 --- a/src/Nova/GmbAccount.php +++ b/src/Nova/GmbAccount.php @@ -9,7 +9,6 @@ use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; use Laravel\Nova\Panel; -use Tipoff\GoogleApi\Nova\Actions\CreateGMBAccount; use Tipoff\Support\Nova\BaseResource; class GmbAccount extends BaseResource @@ -26,10 +25,6 @@ class GmbAccount extends BaseResource public static $group = 'Z - Admin'; - protected array $actionClassList = [ - CreateGMBAccount::class - ]; - public function fieldsForIndex(NovaRequest $request) { return array_filter([