Extras

More Bootstrap goodness from Laravel Bootstrapper.

Modal Call

Build up a modal bit by bit, by using the withTitle(), withBody() and withFooter() methods. Then, create a button to open the modal.

Modal::named('demo-modal')
     ->withTitle('Example modal title')
     ->withBody('Example modal body')
     ->withFooter('Example modal footer')
The named() method will give the modal an id. This is optional, unless you wish to automatically generate a button.

Automatic Button Creation

You can create a button to launch the modal automatically by using the withButton() element.

You must give the modal an id attribute, either by using named(), or by using withAttributes()

Modal::named('button-1')
     ->withTitle('Example automatic button modal title')
     ->withBody('Example automatic button modal body')
     ->withFooter('Example automatic button modal footer')
     ->withButton()

Pass in an instance of Bootstrapper\Button to the withButton() method if you want to customise the button.

Modal::named('button-2')
     ->withTitle('Example automatic button modal title')
     ->withBody('Example automatic button modal body')
     ->withFooter('Example automatic button modal footer')
     ->withButton(Button::primary('I changed this button')->large())

Accordions for hiding expandable content

Basic Usage

Create an accordion using Accordion::named($name) and then use the chained method ->withContents() to fill it with the contents.

Heads Up! The $name parameter will be the id of the created accordion object, and the different sections will have the form $name-0 etc.
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Accordion::named("basic")->withContents([
	[
	    'title' => 'First Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit',
	],
	[
	    'title' => 'Second Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit'
	],
	[
	    'title' => 'Third Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit',
	],
])
The format for the contents is an array of arrays. The inner arrays should be of the form:
array('title' => 'Title', 'contents' => 'Content')

Setting a panel to open by default

Setting a default panel to be open is simple! Just pass in the number that you want opened as the second parameter to ->withContent()

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit
Accordion::named("basic")->withContents([
	[
	    'title' => 'First Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit',
	],
	[
	    'title' => 'Second Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit'
	],
	[
	    'title' => 'Third Panel',
	    'contents' => 'Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit',
	],
])->open(0)

Styling

As with most Bootstrapper objects, the Accordion has a withAttributes(array $attributes) method. You can also pass attributes to each of the accordion panels with the attributes key

What's that when it's at ooam. Is that thine will 'e 'eckerslike tintintin any rooad chuffin' nora gerritetten. Ah'll gi' thee a thick ear gerritetten nobbut a lad. Ee by gum eeh face like a slapped arse. Is that thine wacken thi sen up ah'll gi' thi summat to rooer abaht any rooad wacken thi sen up. Face like a slapped arse. A pint 'o mild. Gi' o'er gerritetten that's champion face like a slapped arse face like a slapped arse. A pint 'o mild. Face like a slapped arse tha what ne'ermind.
Accordion::named('yorkshire')->withContents([
    [
        'title' => 'Attributes',
        'contents' => 'What\'s that when it\'s at ooam. Is that thine will \'e \'eckerslike tintintin any rooad chuffin\' nora gerritetten. Ah\'ll gi\' thee a thick ear gerritetten nobbut a lad. Ee by gum eeh face like a slapped arse. Is that thine wacken thi sen up ah\'ll gi\' thi summat to rooer abaht any rooad wacken thi sen up. Face like a slapped arse. A pint \'o mild. Gi\' o\'er gerritetten that\'s champion face like a slapped arse face like a slapped arse. A pint \'o mild. Face like a slapped arse tha what ne\'ermind.',
        'attributes' => ['class' => 'yorkshire panel-info', 'data-foo' => 'bar'],
    ]
])->withAttributes(['data-foo' => 'bar'])
Heads Up! Want to use .panel-warning etc instead of the default .panel-default? Go ahead! .panel-* have priority over .panel-default

Easily create a tab pane with the tabs() method.

They don't appreciate him. It's his glasses… they make him look like a lizard. Plus he's self-conscious. Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. Her lawyers are claiming the seal is worth $250,000. And that's not even including Buster's Swatch. Operation Hot Mother. It's a jetpack, Michael. What could possibly go wrong?

Suddenly he's too much of a big-shot to brush mother's hair. God knows they're squinters. I thought the two of us could talk man-on-man. I think I might have someone who's going to circumvrent the law. I'm a complete failure. I can't even fake the death of a stripper. Saw this on the highway and almost blue myself. Hop on? Oh please. They didn't sneak into this country to be your friends.

I'm foolish and I'm funny and I'm needy. Am I needy? Are you sure I'm not needy? 'Cause I feel needy sometimes. Let me give that oatmeal some brown sugar. Taste the happy, Michael. Taste it. It tastes kind of like sad. Boy, I sure feel like a Mary without a Peter and a Paul. There are dozens of us! Dozens! Coo coo ca chaw. Coo coo ca chaw. Don't worry, these young beauties have been nowhere near the bananas.

Tabbable::withContents(
    [
        [
            'title' => 'First',
            'content' => "<p>They don't appreciate him..."
        ],
        [
            'title' => 'Second',
            'content' => "<p>Suddenly he's too much of a big-shot..."
        ],
        [
            'title' => 'Third',
            'content' => "<p>I'm foolish and I'm funny and..."
        ]
    ]
)
Each inner array must have a title and content key
Heads up! The title will be slugified (it will be lowercased, and spaces will be converted to '-') and be the id of the tab pane. This can be overridden by adding an attributes key and setting the id there

Pills

These can be turned into pills, by using the pills().

They don't appreciate him. It's his glasses… they make him look like a lizard. Plus he's self-conscious. Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. Her lawyers are claiming the seal is worth $250,000. And that's not even including Buster's Swatch. Operation Hot Mother. It's a jetpack, Michael. What could possibly go wrong?

Suddenly he's too much of a big-shot to brush mother's hair. God knows they're squinters. I thought the two of us could talk man-on-man. I think I might have someone who's going to circumvrent the law. I'm a complete failure. I can't even fake the death of a stripper. Saw this on the highway and almost blue myself. Hop on? Oh please. They didn't sneak into this country to be your friends.

I'm foolish and I'm funny and I'm needy. Am I needy? Are you sure I'm not needy? 'Cause I feel needy sometimes. Let me give that oatmeal some brown sugar. Taste the happy, Michael. Taste it. It tastes kind of like sad. Boy, I sure feel like a Mary without a Peter and a Paul. There are dozens of us! Dozens! Coo coo ca chaw. Coo coo ca chaw. Don't worry, these young beauties have been nowhere near the bananas.

Tabbable::pills(
    [
        [
            'title' => 'First Pills',
            'content' => "<p>They don't appreciate him..."
        ],
        [
            'title' => 'Second Pills',
            'content' => "<p>Suddenly he's too much of a big-shot..."
        ],
        [
            'title' => 'Third Pills',
            'content' => "<p>I'm foolish and I'm funny and..."
        ]
    ]
)

Active States

You can also set which tab to be opened by using the active() method.

They don't appreciate him. It's his glasses… they make him look like a lizard. Plus he's self-conscious. Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. Her lawyers are claiming the seal is worth $250,000. And that's not even including Buster's Swatch. Operation Hot Mother. It's a jetpack, Michael. What could possibly go wrong?

Suddenly he's too much of a big-shot to brush mother's hair. God knows they're squinters. I thought the two of us could talk man-on-man. I think I might have someone who's going to circumvrent the law. I'm a complete failure. I can't even fake the death of a stripper. Saw this on the highway and almost blue myself. Hop on? Oh please. They didn't sneak into this country to be your friends.

I'm foolish and I'm funny and I'm needy. Am I needy? Are you sure I'm not needy? 'Cause I feel needy sometimes. Let me give that oatmeal some brown sugar. Taste the happy, Michael. Taste it. It tastes kind of like sad. Boy, I sure feel like a Mary without a Peter and a Paul. There are dozens of us! Dozens! Coo coo ca chaw. Coo coo ca chaw. Don't worry, these young beauties have been nowhere near the bananas.

Tabbable::pills(
    [
        [
            'title' => 'First Active',
            'content' => "<p>They don't appreciate him..."
        ],
        [
            'title' => 'Second Active',
            'content' => "<p>Suddenly he's too much of a big-shot..."
        ],
        [
            'title' => 'Third Active',
            'content' => "<p>I'm foolish and I'm funny and..."
        ]
    ]
)->active(1)

Fading

They don't appreciate him. It's his glasses… they make him look like a lizard. Plus he's self-conscious. Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. Her lawyers are claiming the seal is worth $250,000. And that's not even including Buster's Swatch. Operation Hot Mother. It's a jetpack, Michael. What could possibly go wrong?

Suddenly he's too much of a big-shot to brush mother's hair. God knows they're squinters. I thought the two of us could talk man-on-man. I think I might have someone who's going to circumvrent the law. I'm a complete failure. I can't even fake the death of a stripper. Saw this on the highway and almost blue myself. Hop on? Oh please. They didn't sneak into this country to be your friends.

I'm foolish and I'm funny and I'm needy. Am I needy? Are you sure I'm not needy? 'Cause I feel needy sometimes. Let me give that oatmeal some brown sugar. Taste the happy, Michael. Taste it. It tastes kind of like sad. Boy, I sure feel like a Mary without a Peter and a Paul. There are dozens of us! Dozens! Coo coo ca chaw. Coo coo ca chaw. Don't worry, these young beauties have been nowhere near the bananas.

Tabbable::pills(
    [
        [
            'title' => 'First Fade',
            'content' => "<p>They don't appreciate him..."
        ],
        [
            'title' => 'Second Fade',
            'content' => "<p>Suddenly he's too much of a big-shot..."
        ],
        [
            'title' => 'Third Fade',
            'content' => "<p>I'm foolish and I'm funny and..."
        ]
    ]
)->fade()