{"id":28476626,"url":"https://github.com/armincms/nova-tab","last_synced_at":"2025-07-02T16:31:16.320Z","repository":{"id":62487160,"uuid":"216498599","full_name":"armincms/nova-tab","owner":"armincms","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-16T09:53:13.000Z","size":131,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-07T15:07:21.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/armincms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-21T06:58:33.000Z","updated_at":"2020-04-24T07:47:30.000Z","dependencies_parsed_at":"2022-11-02T11:00:34.259Z","dependency_job_id":null,"html_url":"https://github.com/armincms/nova-tab","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/armincms/nova-tab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armincms%2Fnova-tab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armincms%2Fnova-tab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armincms%2Fnova-tab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armincms%2Fnova-tab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/armincms","download_url":"https://codeload.github.com/armincms/nova-tab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/armincms%2Fnova-tab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263175409,"owners_count":23425563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T15:07:21.435Z","updated_at":"2025-07-02T16:31:16.305Z","avatar_url":"https://github.com/armincms.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nova Tab\n\nField's Grouping by the tab.\n\n##### Table of Contents   \n* [Install](#install)  \n* [Quick Start](#quick-start)    \n* [Usage](#quick-usage)    \n* [Multiple Tabs](#multiple-tabs)    \n* [Using With Panel](#using-with-panel)    \n* [Relations](#relations)    \n* [Missed Tabs](#missed-tabs)    \n\n## Install\n```bash\ncomposer require armincms/nova-tab\n``` \n \n## Quick Start \nFirst create your tab like follow. \n\n\n```\nTab::make('tab-name', [\n  'first-group-name' =\u003e 'First Group Label',\n  'second-group-name' =\u003e 'Second Group Label',\n  'fourth-group' =\u003e [\n    // group fields\n  ],\n  'fifth-group' =\u003e function() {\n    return [\n      // group fields\n    ];\n  }\n])-\u003efullwidth();\n```\nThen, to insert each field into the created tab; pass the `name` and the `group name` \n  into the `withTab` macro method.for example:\n\n```\n  Text::make('Name')-\u003ewithTab('tab-name', 'first-group-name');\n  Text::make('Gender')-\u003ewithTab('tab-name', 'second-group-name');\n```\n\n## Usage\nFirst create your tab like follow. Then; for define tab `field's`, you can use the `group` method.\n\n```\nTab::make('tab-name', function($tab) {\n\n    // pass fields by callback\n    $tab-\u003egroup('first-tab-name', function($group) {  \n      return [\n\n        // define your tab fields\n\n      ];\n    });\n    \n    // pass fields by array\n    // active your tab by `active` method\n    $tab-\u003egroup('active-tab', [ \n\n        // define your tab fields\n\n    ])-\u003eactive();\n\n    // custom label tab\n    $tab-\u003egroup('custom-label-tab', function($group) {  \n      // or inside the group\n      $group-\u003elabel('My Custom Label');\n      \n      return [\n\n        // define your tab fields\n\n      ];\n    })-\u003elabel('My Custom Label');\n  \n  // full width tab by call `fullwidth` method\n})-\u003efullwidth();\n```\n\n\n### Ative Tab:\nBy default we'll active the first tab. if you want customize the `active tab`, \n  it's availabe by call the `active` method on the tab `group`.\n\n### Tab Label \nIt's possible to customize the `tab label's` by passing the label string through the \n`label` method on the `group`. \n\n### Full Width Tab  \nIf you want jsutify the tab for fill screen; you can call `fullWidth` method on the `Tab::class` \n\n#### Attention 1: you can add any `field` and `relation-field` into the tab. \n#### Attention 2: it's impossible to add `Panel` into the tab.\n#### Attention 3: It's possible to add the `tab` into the `Panel`. \n \n* base example:\n\n``` \n    use Armincms\\Tab\\Tab;    \n\n\n\n    /**\n     * Get the fields displayed by the resource.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return array\n     */\n    public function fields(Request $request)\n    {\n        return Tab::make('general', function($tab) {\n          $tab-\u003egroup('general', [\n              ID::make()-\u003esortable(),  \n\n              Select::make('Tag')-\u003eoptions(function() {\n                  return ['*' =\u003e 'all'];\n              })-\u003edefault('*'),     \n          ])-\u003elabel(__('General')); \n\n          $tab-\u003egroup('SEO', [ \n              Text::make('Title'), \n          ])-\u003eactive();  \n\n          $tab-\u003egroup('Relations', [\n              MorphToMany::make('Tag'),  \n          ])-\u003elabel('Relations');  \n        })-\u003etoArray(); \n    }\n```\n\n* Fullwidth tab example:\n\n``` \n    use Armincms\\Tab\\Tab;    \n\n\n\n    /**\n     * Get the fields displayed by the resource.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return array\n     */\n    public function fields(Request $request)\n    {\n        return Tab::make('general', function($tab) {\n          $tab-\u003egroup('general', [$this, 'generalFields'])-\u003elabel(__('General')); \n\n          $tab-\u003egroup('SEO', [ \n              Text::make('Title'), \n          ])-\u003eactive();  \n\n          $tab-\u003egroup('Relations', [\n              MorphToMany::make('Tag'),  \n          ])-\u003elabel('Relations');  \n        })-\u003efullwidth()-\u003etoArray(); \n    }\n\n    public function generalFields() \n    {\n      return $this-\u003emerge([\n        ID::make()-\u003esortable(),   \n        Select::make('Tag')-\u003eoptions(function() {\n            return ['*' =\u003e 'all'];\n        })-\u003edefault('*'),\n      ]);\n    }\n```\n\n## Multiple Tabs\nYou can add multiple tab into `form` and `detail` page.\n  for this situation; just needs making different name for different tabs.\n\n#### Attention 1: You can't add same` relation-field` in different tabs.it just work with one of them.\n\n```\n\n    use Armincms\\Tab\\Tab;    \n\n\n\n    /**\n     * Get the fields displayed by the resource.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return array\n     */\n    public function fields(Request $request)\n    {\n        return [       \n            Tab::make('first-tab', function($tab) {\n                $tab-\u003egroup('general', [$this, 'generalFields'])-\u003elabel(__('General')); \n\n                $tab-\u003egroup('SEO', [ \n                    Text::make('Title'), \n                ])-\u003eactive();  \n\n                $tab-\u003egroup('Relations', [\n                    MorphToMany::make('Tag'),  \n                ])-\u003elabel('Relations');  \n            }),  \n            Tab::make('second-tab', function($tab) {\n                $tab-\u003egroup('general', [\n                    ID::make()-\u003esortable(),  \n\n                    Select::make('Tag')-\u003eoptions(function() {\n                        return ['*' =\u003e 'all'];\n                    })-\u003edefault('*'),     \n                ])-\u003elabel(__('General')); \n\n                $tab-\u003egroup('SEO', [ \n                    Text::make('Title'), \n                ])-\u003eactive();  \n\n                $tab-\u003egroup('Relations', [\n                    MorphToMany::make('Category'),  \n                ])-\u003elabel('Relations');  \n            }),    \n        ]; \n    }\n\n    \n    public function generalFields() \n    {\n      return $this-\u003emerge([\n        ID::make()-\u003esortable(),   \n        Select::make('Tag')-\u003eoptions(function() {\n            return ['*' =\u003e 'all'];\n        })-\u003edefault('*'),\n      ]);\n    }\n```\n\n## Using With Panel\nYou can add tab into `Panel` but you never can add `Panel` into tab.\n\n```\n\n    use Armincms\\Tab\\Tab;    \n\n\n\n    /**\n     * Get the fields displayed by the resource.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return array\n     */\n    public function fields(Request $request)\n    {\n        return [     \n            new Panel('First Panel', [  \n                Tab::make('general', function($tab) {\n                    $tab-\u003egroup('general', [\n                        ID::make()-\u003esortable(),  \n\n                        Select::make('Tag')-\u003eoptions(function() {\n                            return ['*' =\u003e 'all'];\n                        })-\u003edefault('*'),     \n                    ])-\u003elabel(__('General')); \n\n                    $tab-\u003egroup('SEO', [ \n                        Text::make('Title'), \n                    ])-\u003eactive();  \n\n                    $tab-\u003egroup('Relations', [\n                        MorphToMany::make('Tag'),  \n                    ])-\u003elabel('Relations');  \n                }), \n            ]), \n    }\n```\n\n\n## Relations\n\n```\n\n    use Armincms\\Tab\\Tab;    \n\n\n\n    /**\n     * Get the fields displayed by the resource.\n     *\n     * @param  \\Illuminate\\Http\\Request  $request\n     * @return array\n     */\n    public function fields(Request $request)\n    {\n        return [     \n            new Panel('My Panel', [  \n                Tab::make('general', function($tab) {\n                    $tab-\u003egroup('Author', [\n                        ID::make()-\u003esortable(),  \n\n                        BelogsTo::make('User'),   \n                    ])-\u003elabel(__('General'));  \n\n                    $tab-\u003egroup('Relations', [\n                        MorphToMany::make('Tag'),  \n                    ])-\u003elabel('Relations');  \n                }), \n            ])   \n        ]; \n    }\n```\n\n\n## Missed Tabs\n\nIf some fields missing in the tab, with macro method `withTab` you can add the \n  missed field into the tab. like following example:\n\n```\n  Text::make('FieldName')-\u003ewithTab('tab-name', 'group-name')\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmincms%2Fnova-tab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farmincms%2Fnova-tab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farmincms%2Fnova-tab/lists"}