From 54b85f642b2fdb380d9846376e438a90a9810604 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 9 Jun 2023 20:30:09 +0200 Subject: [PATCH] Statamic v4 compatibility --- .gitignore | 2 ++ routes/cp.php | 4 ++-- src/Http/Controllers/TrackingCodeManagerController.php | 4 ++-- src/ServiceProvider.php | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8078200 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +src/.DS_Store +.DS_Store diff --git a/routes/cp.php b/routes/cp.php index 4ef452d..7ba91cc 100644 --- a/routes/cp.php +++ b/routes/cp.php @@ -1,6 +1,6 @@ group(function () { - Route::get('/simonridley/trackingcodemanager/', 'TrackingCodeManagerController@index')->name('simonridley.tracking-code-manager.index'); - Route::post('/simonridley/trackingcodemanager/', 'TrackingCodeManagerController@update')->name('simonridley.tracking-code-manager.update'); + Route::get('/simonridley/trackingcodemanager/', '\Simonridley\TrackingCodeManager\Http\Controllers\TrackingCodeManagerController@index')->name('simonridley.tracking-code-manager.index'); + Route::post('/simonridley/trackingcodemanager/', '\Simonridley\TrackingCodeManager\Http\Controllers\TrackingCodeManagerController@update')->name('simonridley.tracking-code-manager.update'); }); diff --git a/src/Http/Controllers/TrackingCodeManagerController.php b/src/Http/Controllers/TrackingCodeManagerController.php index dcce652..16331c8 100644 --- a/src/Http/Controllers/TrackingCodeManagerController.php +++ b/src/Http/Controllers/TrackingCodeManagerController.php @@ -16,7 +16,7 @@ class TrackingCodeManagerController extends Controller public function index(Request $request) { - $blueprint = Blueprint::makeFromSections(FooFields::getOrganizationFields()); + $blueprint = Blueprint::makeFromTabs(FooFields::getOrganizationFields()); $fields = $blueprint->fields(); $values = collect(YAML::file(__DIR__.'/../content/tracking-codes.yaml')->parse()) @@ -36,7 +36,7 @@ public function index(Request $request) public function update(Request $request): void { - $blueprint = Blueprint::makeFromSections(FooFields::getOrganizationFields()); + $blueprint = Blueprint::makeFromTabs(FooFields::getOrganizationFields()); $fields = $blueprint->fields(); $fields = $fields->addValues($request->all()); diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 65cfbab..6ebed9d 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -21,8 +21,8 @@ public function boot():void Nav::extend(static function ($nav) { $nav->tools('Tracking Code Mgr') ->route('simonridley.tracking-code-manager.index') - ->icon('performance-increase') - ->active('tracking-code-manager'); + ->icon('') + ->active('tracking-code-manager'); }); } }