PHPackages                             fish/laratabs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. fish/laratabs

ActiveLibrary[Templating &amp; Views](/categories/templating)

fish/laratabs
=============

Artisan command to create bootstrap tabs and place each tab within its own view

2.0(10y ago)02033[1 issues](https://github.com/matfish2/laratabs/issues)MITPHPPHP &gt;=5.5.9

Since Oct 10Pushed 10y ago2 watchersCompare

[ Source](https://github.com/matfish2/laratabs)[ Packagist](https://packagist.org/packages/fish/laratabs)[ RSS](/packages/fish-laratabs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/b11c037c852e65ab7d50826b571562c0d40bc6694e4ab33b89c4f77e1a83cbb3/68747470733a2f2f706f7365722e707567782e6f72672f666973682f6c617261746162732f762f737461626c652e737667)](https://packagist.org/packages/fish/laratabs) [![Total Downloads](https://camo.githubusercontent.com/ad8d7324e9fce82ec01b65e3fd2164bb7e6511c3e28df0bd4aea4e84b78f961a/68747470733a2f2f706f7365722e707567782e6f72672f666973682f6c617261746162732f646f776e6c6f6164732e737667)](https://packagist.org/packages/fish/laratabs) [![Latest Unstable Version](https://camo.githubusercontent.com/b851cf0f6cb9b22e0c0389f27f590c113061017ea1221b70cf3cb7b056861e3d/68747470733a2f2f706f7365722e707567782e6f72672f666973682f6c617261746162732f762f756e737461626c652e737667)](https://packagist.org/packages/fish/laratabs) [![License](https://camo.githubusercontent.com/7204b1d95082cffb0a0bf0e6a0434d7d3c9f01c1c68f0e0018d7fe3f7cbab66e/68747470733a2f2f706f7365722e707567782e6f72672f666973682f6c617261746162732f6c6963656e73652e737667)](https://packagist.org/packages/fish/laratabs)

### Note: this version is for laravel 5 only. For laravel 4 specify in your composer version `^1.0` instead of `^2.0`.

[](#note-this-version-is-for-laravel-5-only-for-laravel-4-specify-in-your-composer-version-10-instead-of-20)

Generate Bootstrap tabs in your Laravel app
===========================================

[](#generate-bootstrap-tabs-in-your-laravel-app)

This Laravel package provides an artisan command to easily generate bootstrap tabs. The package creates a unique view for each tab, and allows you to embed the tabs wherever you need in your HTML. This 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.

- [Installation](#installation)
- [Usage](#usage)
    - [Generate the tabs](#generate-the-tabs)
    - [Fill the views with content](#fill-the-views-with-content)
    - [Pull the tabs into your view](#pull-the-tabs-into-your-view)
        - [Syntax](#syntax)
        - [Usage](#usage-1)
- [Config](#config)

Installation
------------

[](#installation)

Begin by installing this package through Composer. Edit your project's `composer.json` file to require `fish/laratabs`.

```
"require": {
	"fish/laratabs": "^2.0"
}

```

Next, update Composer from the Terminal:

```
composer update

```

Once 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.

```
Fish\Laratabs\LaratabsServiceProvider::class

```

On the client-side remember to include bootstrap's CSS and JavaScript files. The quickest way is using a CDN:

```

```

That's it! You're all set to go. Run the `artisan` command from the Terminal to see the new `tabs` command.

```
php artisan

```

Usage
-----

[](#usage)

### Generate the tabs

[](#generate-the-tabs)

On the first time you use the package run the following to build the database tables: (unless you choose 'file' for storage)

```
php artisan tabs:init

```

Now create the tabs:

```
php artisan tabs:generate [key] [--tabs="list-of-tabs"]

```

First provide the key, which you will use later to grab the tabs, and then list the tabs. The tabs should be entered as a comma separated list. The words are spearated by default with an underscore. Of course, when presented in the view they will be separated by spaces. As for capitaliztion, by default the first word will be uppercase.

if you want to create a tab with dropdown menu the syntax is `main_tab:sub_tab1|sub_tab2`.

Example:

```
php artisan tabs:generate article --tabs="section1, section2, section3:sub_section1|sub_section2"

```

Note that the key is also used by default to set the name of the folder, where the tabs partials will be created.

### Fill the views with content

[](#fill-the-views-with-content)

The views will reside by default under `app/views/[key]`.

### Pull the tabs into your view

[](#pull-the-tabs-into-your-view)

#### Syntax

[](#syntax)

```
Tabs::get($key, $data = [], $options = []);

```

`$key`(string)(required) The key used while generating the tabs.

`$data`(assoc. array)(optional) data to be passed to the views.

`$options`(assoc. array)(optional) customization [options](#options).

#### Usage

[](#usage-1)

In your controller pass the returned value to the main view, e.g:

```
return View::make('main.view', ['tabs'=>Tabs::get('article')]);

```

Then in your view echo {!! $tabs !!} wherever you want the tabs to appear.

Config
------

[](#config)

The 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. local options are passed as the third argument to the `get` method, while global options are set in the pacakage `config.php` file.

To change the global configuration you need to publish it to your project first:

```
 php artisan vendor:publish

```

The path to the published file is:

```
config/laratabs.php

```

### Options

[](#options)

OptionDescriptionScopeValuesDefaulttypeGLtabs,pillstabsstorageGdatabase, filedatabasedirectionGLhorizontal, verticalhorizontalviews\_pathThe path where theGthe key used whentabs partials will be createdcreating the tabsrelative to the views folder.fadeuse fade effect?GLtrue, falsetruein the artisan commanddisplayDisplay of the titlesGLuc\_first\_word,uc\_first\_worduc\_all\_words,uc\_no\_words,[locale](#locale)exceptblack-list of tabsL\[array, of, tabs\]not to be presentedonlywhite-list of tabsL\[array, of, tabs\]to be presented#### Locale

[](#locale)

The locale option will look for the translation in a `tabs.php` file under the current locale. The array returned from the file should be constructed as follows:

```
[
    'some-key'=> [
       'tab1' => 'Tab no. 1'
       'tab2' => 'Tab no. 2'
       'tab3' => 'Tab no. 3'
    ]

    'some-other-key'=> [
       'tab4' => 'Tab no. 4'
       'tab5' => 'Tab no. 5'
       'tab6' => 'Tab no. 6'
    ]
]

```

If no translation is found it will fallback to `uc_first_word`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3873d ago

Major Versions

1.0 → 2.02015-10-10

PHP version history (2 changes)1.0PHP &gt;=5.4.0

2.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/ef7c699ed71e1fdeb389a1aba23f26d02a0a9b7554dd9b8375b739c0357f7339?d=identicon)[matfish2](/maintainers/matfish2)

---

Top Contributors

[![matfish2](https://avatars.githubusercontent.com/u/1510460?v=4)](https://github.com/matfish2 "matfish2 (44 commits)")

---

Tags

laravelbootstraptabs

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/fish-laratabs/health.svg)

```
[![Health](https://phpackages.com/badges/fish-laratabs/health.svg)](https://phpackages.com/packages/fish-laratabs)
```

###  Alternatives

[tomjamon/laravel-custom-html

Custom HTML generator for Laravel (Based on LaravelCollective HTML)

1018.6k](/packages/tomjamon-laravel-custom-html)[cornford/bootstrapper

An easy way to intergrate Twitter Bootstrap with Laravel.

232.7k](/packages/cornford-bootstrapper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
