Skip to content

Commit

Permalink
Merge pull request #6 from hhhc/statamic-v4
Browse files Browse the repository at this point in the history
Statamic v4 compatibility
  • Loading branch information
simonridley authored Jun 22, 2023
2 parents 8ed303a + 54b85f6 commit c4dce88
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/.DS_Store
.DS_Store
4 changes: 2 additions & 2 deletions routes/cp.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

Route::middleware('web')->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');
});
4 changes: 2 additions & 2 deletions src/Http/Controllers/TrackingCodeManagerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M.75 23.25h22.5M6 17.25H3a.75.75 0 0 0-.75.75v5.25h4.5V18a.75.75 0 0 0-.75-.75zm7.5-7.5h-3a.75.75 0 0 0-.75.75v12.75h4.5V10.5a.75.75 0 0 0-.75-.75zm7.5 3h-3a.75.75 0 0 0-.75.75v9.75h4.5V13.5a.75.75 0 0 0-.75-.75zm2.25-7.5V.75h-4.5"></path><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M23.25.75 18.2 5.8a2.249 2.249 0 0 1-2.237.564l-5.709-1.526a2.251 2.251 0 0 0-2.172.583L2.25 11.253"></path></svg>')
->active('tracking-code-manager');
});
}
}

0 comments on commit c4dce88

Please sign in to comment.