Skip to content

Commit

Permalink
Merge pull request #21 from lara-zeus/fix-getting-the-key
Browse files Browse the repository at this point in the history
fix getting the key instead of the label
  • Loading branch information
atmonshi authored May 15, 2024
2 parents 2d700ed + 1046c58 commit 13efda7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 39 deletions.
38 changes: 0 additions & 38 deletions src/Forms/Components/MultiLang-.php

This file was deleted.

11 changes: 10 additions & 1 deletion src/Forms/Components/MultiLang.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@

class MultiLang extends Tabs
{
public static string $theMainKeyThingy = '';

public static function make(?string $label = null): static
{
static::$theMainKeyThingy = $label;

return parent::make($label);
}

protected function setUp(): void
{
parent::setUp();
Expand All @@ -16,7 +25,7 @@ protected function setUp(): void
$tabs = [];
foreach (config('app.locales') as $lang => $info) {
$tabs[] = Tabs\Tab::make('tab-' . $lang)
->statePath($this->getLabel())
->statePath(static::$theMainKeyThingy)
->label($info['name'])
->formatStateUsing(function (): array {
$defaultDataForLang = [];
Expand Down

0 comments on commit 13efda7

Please sign in to comment.