Download the PHP package fish/laratabs without Composer

On this page you can find all versions of the php package fish/laratabs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laratabs

Latest Stable Version Total Downloads Latest Unstable Version License

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

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

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:

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

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

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

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

Pull the tabs into your view

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.

Usage

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

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

Option Description Scope Values Default
type GL tabs,pills tabs
storage G database, file database
direction GL horizontal, vertical horizontal
views_path The path where the G the key used when
tabs partials will be created creating the tabs
relative to the views folder.
fade use fade effect? GL true, false true
in the artisan command
display Display of the titles GL uc_first_word, uc_first_word
uc_all_words,
uc_no_words,
locale
except black-list of tabs L [array, of, tabs]
not to be presented
only white-list of tabs L [array, of, tabs]
to be presented

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.


All versions of laratabs with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
illuminate/support Version >=5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package fish/laratabs contains the following files

Loading the files please wait ....