{"id":21598105,"url":"https://github.com/matfish2/laratabs","last_synced_at":"2025-04-11T01:01:52.946Z","repository":{"id":21121293,"uuid":"24422044","full_name":"matfish2/laratabs","owner":"matfish2","description":"Artisan command to generate reusable bootstrap tabs and place each tab within its own view","archived":false,"fork":false,"pushed_at":"2016-02-04T16:18:52.000Z","size":68,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T21:42:32.797Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fish/laratabs","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/matfish2.png","metadata":{"files":{"readme":"readme.md","changelog":null,"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":"2014-09-24T16:04:44.000Z","updated_at":"2016-02-04T16:18:52.000Z","dependencies_parsed_at":"2022-08-25T17:23:39.497Z","dependency_job_id":null,"html_url":"https://github.com/matfish2/laratabs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Flaratabs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Flaratabs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Flaratabs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matfish2%2Flaratabs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matfish2","download_url":"https://codeload.github.com/matfish2/laratabs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322600,"owners_count":21084336,"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":"2024-11-24T18:11:18.455Z","updated_at":"2025-04-11T01:01:52.909Z","avatar_url":"https://github.com/matfish2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/fish/laratabs/v/stable.svg)](https://packagist.org/packages/fish/laratabs) [![Total Downloads](https://poser.pugx.org/fish/laratabs/downloads.svg)](https://packagist.org/packages/fish/laratabs) [![Latest Unstable Version](https://poser.pugx.org/fish/laratabs/v/unstable.svg)](https://packagist.org/packages/fish/laratabs) [![License](https://poser.pugx.org/fish/laratabs/license.svg)](https://packagist.org/packages/fish/laratabs)\n\n### Note: this version is for laravel 5 only. For laravel 4 specify in your composer version `^1.0` instead of `^2.0`.\n\n# Generate Bootstrap tabs in your Laravel app\n\nThis Laravel package provides an artisan command to easily generate bootstrap tabs.\nThe package creates a unique view for each tab, and allows you to embed the tabs wherever you need in your HTML.\nThis makes for a clean uncluttered code, and allows you to skip the tedious process of writing the HTML yourself and focus on the content of the tabs.\n\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Generate the tabs](#generate-the-tabs)\n    - [Fill the views with content](#fill-the-views-with-content)\n    - [Pull the tabs into your view](#pull-the-tabs-into-your-view)\n        - [Syntax](#syntax)\n        - [Usage](#usage-1)\n- [Config](#config)\n\n## Installation\n\nBegin by installing this package through Composer. Edit your project's `composer.json` file to require `fish/laratabs`.\n\n\t\"require\": {\n\t\t\"fish/laratabs\": \"^2.0\"\n\t}\n\nNext, update Composer from the Terminal:\n\n    composer update\n\nOnce this operation completes, the final step is to add the service provider. Open `app/config/app.php`, and add a new item to the providers array.\n\n    Fish\\Laratabs\\LaratabsServiceProvider::class\n\nOn the client-side remember to include bootstrap's CSS and JavaScript files. The quickest way is using a CDN:\n\n    \u003clink href=\"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css\" rel=\"stylesheet\"\u003e\n    \u003cscript src=\"//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n\nThat's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `tabs` command.\n\n    php artisan\n\n## Usage\n\n### Generate the tabs\n\nOn the first time you use the package run the following to build the database tables: (unless you choose 'file' for storage)\n\n    php artisan tabs:init\n\nNow create the tabs:\n\n    php artisan tabs:generate [key] [--tabs=\"list-of-tabs\"]\n\nFirst provide the key, which you will use later to grab the tabs, and then list the tabs.\nThe tabs should be entered as a comma separated list. The words are spearated by default with an underscore.\nOf course, when presented in the view they will be separated by spaces. As for capitaliztion, by default the first word will be uppercase.\n\nif you want to create a tab with dropdown menu the syntax is `main_tab:sub_tab1|sub_tab2`.\n\nExample:\n\n    php artisan tabs:generate article --tabs=\"section1, section2, section3:sub_section1|sub_section2\"\n\nNote that the key is also used by default to set the name of the folder, where the tabs partials will be created.\n\n### Fill the views with content\n\nThe views will reside by default under `app/views/[key]`.\n\n### Pull the tabs into your view\n\n#### Syntax\n    Tabs::get($key, $data = [], $options = []);\n\n`$key`\n(string)(required) The key used while generating the tabs.\n\n`$data`\n(assoc. array)(optional) data to be passed to the views.\n\n`$options`\n(assoc. array)(optional) customization [options](#options).\n\n#### Usage\n\nIn your controller pass the returned value to the main view, e.g:\n\n    return View::make('main.view', ['tabs'=\u003eTabs::get('article')]);\n\nThen in your view echo {!! $tabs !!} wherever you want the tabs to appear.\n\n## Config\n\nThe package allows you to config a few options, each of which is applicable either globally (G) - i.e for all sets of tabs, locally (L) - i.e for the current set of tabs, or both.\nlocal options are passed as the third argument to the `get` method, while global options are set in the pacakage `config.php` file.\n\nTo change the global configuration you need to publish it to your project first:\n\n     php artisan vendor:publish\n\nThe path to the published file is:\n\n    config/laratabs.php\n\n### Options\n\n| Option         | Description                     | Scope   | Values               | Default             |\n|:-------------  |:-------------                   |:-----   |:-----                |:-------             |\n| type           |                                 | GL      | tabs,pills           | tabs                |\n| storage        |                                 | G       | database, file       | database            |\n| direction      |                                 | GL      | horizontal, vertical | horizontal          |\n| views_path     | The path where the              |  G      |                      | the key used when\n|                |  tabs partials will be created      |        |                        |  creating the tabs\n|                |  relative to the views folder.   |        |                        |                      |                                                               |                     |\n| fade           | use fade effect?                | GL      | true, false          | true                |            |\n|                |  in the artisan command         |          |                      |                     |\n| display        | Display of the titles           | GL      |  uc_first_word,      | uc_first_word       |\n|                |                                 |         |   uc_all_words,       |                     |\n|                |                                 |         |   uc_no_words,        |                     |\n|                |                                 |         |   [locale](#locale)              |                     |\n| except         | black-list of tabs              | L       |  [array, of, tabs]   |                     |\n|                | not to be presented             |         |                      |                     |\n| only           | white-list of tabs              | L       |  [array, of, tabs]   |                     |\n|                | to be presented                 |         |                      |                     |\n\n#### Locale\n\nThe locale option will look for the translation in a `tabs.php` file under the current locale.\nThe array returned from the file should be constructed as follows:\n\n    [\n        'some-key'=\u003e [\n           'tab1' =\u003e 'Tab no. 1'\n           'tab2' =\u003e 'Tab no. 2'\n           'tab3' =\u003e 'Tab no. 3'\n        ]\n\n        'some-other-key'=\u003e [\n           'tab4' =\u003e 'Tab no. 4'\n           'tab5' =\u003e 'Tab no. 5'\n           'tab6' =\u003e 'Tab no. 6'\n        ]\n    ]\n\nIf no translation is found it will fallback to `uc_first_word`.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfish2%2Flaratabs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatfish2%2Flaratabs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatfish2%2Flaratabs/lists"}