Repository: appstract/laravel-bootstrap-components
Branch: master
Commit: b0dfcaab8b53
Files: 28
Total size: 14.5 KB
Directory structure:
gitextract_3r_yz7i8/
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── .travis.yml
├── LICENSE.md
├── README.md
├── composer.json
├── phpunit.xml.dist
├── resources/
│ └── views/
│ ├── alert.blade.php
│ ├── badge.blade.php
│ ├── breadcrumb.blade.php
│ ├── button-group.blade.php
│ ├── card.blade.php
│ ├── carousel.blade.php
│ ├── figure.blade.php
│ ├── input-group.blade.php
│ ├── jumbotron.blade.php
│ ├── list-group.blade.php
│ ├── modal.blade.php
│ ├── pagination.blade.php
│ ├── progress.blade.php
│ ├── render/
│ │ └── pagination.blade.php
│ └── table.blade.php
├── src/
│ ├── BootstrapComponentsClass.php
│ ├── BootstrapComponentsFacade.php
│ └── BootstrapComponentsServiceProvider.php
└── tests/
└── ExampleTest.php
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
================================================
FILE: .gitattributes
================================================
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/tests export-ignore
================================================
FILE: .gitignore
================================================
# Crap
*.log
.sass-cache
.Spotlight-V100
.Trashes
.DS_Store
.DS_Store?
ehthumbs.db
Thumbs.db
# IDE
*.sublime-*
*.idea
.idea
# Project
build
composer.lock
docs
vendor
================================================
FILE: .styleci.yml
================================================
preset: laravel
disabled:
- single_class_element_per_statement
================================================
FILE: .travis.yml
================================================
language: php
php:
- 7.2
- 7.3
env:
- LARAVEL_VERSION=5.7.*
- LARAVEL_VERSION=5.8.*
- LARAVEL_VERSION=^6.0
- LARAVEL_VERSION=^7.0
before_script:
- travis_retry composer self-update
- composer require laravel/framework:${LARAVEL_VERSION}
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
script:
- php vendor/bin/phpunit --coverage-text
================================================
FILE: LICENSE.md
================================================
# The MIT License (MIT)
Copyright (c) Appstract
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
> in the Software without restriction, including without limitation the rights
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> copies of the Software, and to permit persons to whom the Software is
> furnished to do so, subject to the following conditions:
>
> The above copyright notice and this permission notice shall be included in
> all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> THE SOFTWARE.
================================================
FILE: README.md
================================================
# Laravel Bootstrap Components
[](https://packagist.org/packages/appstract/laravel-bootstrap-components)
[](https://packagist.org/packages/appstract/laravel-bootstrap-components)
[](LICENSE.md)
Easily use Bootstrap 4 components as Laravel components.
You can help with adding components by creating a pull request.
## Installation
You can install the package via composer:
```bash
composer require appstract/laravel-bootstrap-components
```
## Usage
Examples:
```blade
@component('bootstrap::modal')
This is the content of the modal
@endcomponent
@component('bootstrap::progress', ['value' => 75])
// Extra bars
@endcomponent
```
More components and documentation [in the wiki](https://github.com/appstract/laravel-bootstrap-components/wiki).
## Contributing
Contributions are very welcome! If you want to add a component, please keep the following in mind when creating a pull request:
- Have a look at the existing components for examples.
- Customization of the component (like custom classes and options for the component).
- Provide some docs in the [wiki](https://github.com/appstract/laravel-bootstrap-components/wiki).
[Thanks to all the contributors](https://github.com/appstract/laravel-bootstrap-components/graphs/contributors)
## About Appstract
Appstract is a small team from The Netherlands. We create (open source) tools for webdevelopment and write about related subjects on [Medium](https://medium.com/appstract). You can [follow us on Twitter](https://twitter.com/teamappstract), [buy us a beer](https://www.paypal.me/teamappstract/10) or [support us on Patreon](https://www.patreon.com/appstract).
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
================================================
FILE: composer.json
================================================
{
"name": "appstract/laravel-bootstrap-components",
"description": "Bootstrap components for Laravel",
"keywords": [
"appstract",
"laravel-bootstrap-components"
],
"homepage": "https://github.com/appstract/laravel-bootstrap-components",
"license": "MIT",
"authors": [
{
"name": "Gijs Jorissen",
"email": "mail@appstract.nl",
"homepage": "https://appstract.nl",
"role": "Developer"
},
{
"name": "Olav van Schie",
"email": "mail@appstract.nl",
"homepage": "https://appstract.nl",
"role": "Developer"
},
{
"name": "Bob Krijnen",
"email": "mail@appstract.nl",
"homepage": "https://appstract.nl",
"role": "Developer"
},
{
"name": "Teun de Kleijne",
"email": "mail@appstract.nl",
"homepage": "https://appstract.nl",
"role": "Developer"
}
],
"require": {
"php": "^7.1.3",
"laravel/framework": ">=5.7",
"appstract/laravel-blade-directives": "^1.8"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
},
"autoload": {
"psr-4": {
"Appstract\\BootstrapComponents\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Appstract\\BootstrapComponents\\Test\\": "tests"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"config": {
"sort-packages": true
},
"extra": {
"laravel": {
"providers": [
"Appstract\\BootstrapComponents\\BootstrapComponentsServiceProvider"
]
}
}
}
================================================
FILE: phpunit.xml.dist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="vendor/autoload.php"
backupGlobals="false"
backupStaticAttributes="false"
colors="true"
verbose="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Appstract Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<logging>
<log type="tap" target="build/report.tap"/>
<log type="junit" target="build/report.junit.xml"/>
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
<log type="coverage-text" target="build/coverage.txt"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>
</phpunit>
================================================
FILE: resources/views/alert.blade.php
================================================
<div
class="
alert alert-{{ $type }}
{{ $class ?? '' }}
@istrue($dismissible, 'alert-dismissible')
@istrue($animate, 'fade show')
"
role="alert"
>
@istrue($dismissible)
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
@endistrue
{{ $slot }}
</div>
================================================
FILE: resources/views/badge.blade.php
================================================
<span
class="
badge
badge-{{ $type }}
{{ $class ?? '' }}
@istrue($pill, 'badge-pill')
"
>
{{ $slot }}
</span>
================================================
FILE: resources/views/breadcrumb.blade.php
================================================
<nav class="breadcrumb {{ $class ?? '' }}">
{{ $slot }}
</nav>
================================================
FILE: resources/views/button-group.blade.php
================================================
<div
class="btn-group {{ $class ?? '' }}"
role="group"
>
{{ $slot }}
</div>
================================================
FILE: resources/views/card.blade.php
================================================
<div
class="card {{ $class ?? '' }}"
>
@isset($header)
<div class="card-header">
{!! $header !!}
</div>
@endisset
{{ $slot }}
@isset($footer)
<div class="card-footer">
{!! $footer !!}
</div>
@endisset
</div>
================================================
FILE: resources/views/carousel.blade.php
================================================
<div
id="{{ $id ?? 'carousel' }}"
class="carousel slide {{ $class ?? '' }}"
data-ride="carousel"
>
@istrue($indicators)
<ol class="carousel-indicators">
@isset($items)
@foreach($items as $item)
<li data-target="#{{ $id ?? 'carousel' }}" data-slide-to="{{ $loop->index }}"></li>
@endforeach
@else
{!! $indicators !!}
@endisset
</ol>
@endistrue
<div class="carousel-inner" role="listbox">
@isset($items)
@foreach($items as $item)
<div class="carousel-item @istrue($loop->first, 'active')">{{ $item }}</div>
@endforeach
@endisset
{{ $slot }}
</div>
@istrue($controls)
<a class="carousel-control-prev" href="#{{ $id ?? 'carousel' }}" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#{{ $id ?? 'carousel' }}" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
@endistrue
</div>
================================================
FILE: resources/views/figure.blade.php
================================================
<figure class="figure {{ $class ?? '' }}">
{{ $slot }}
@isset($caption)
<figcaption class="figure-caption">{!! $caption !!}</figcaption>
@endisset
</figure>
================================================
FILE: resources/views/input-group.blade.php
================================================
<div class="input-group {{ $class ?? '' }}">
{{ $slot }}
</div>
================================================
FILE: resources/views/jumbotron.blade.php
================================================
<div
class="
jumbotron
{{ $class ?? '' }}
@istrue($fullwidth, 'jumbotron-fluid')
"
>
@istrue($fullwidth, '<div class="container">')
@isset($heading)
<h1 class="display-3">{!! $heading !!}</h1>
@endisset
{{ $slot }}
@istrue($fullwidth, '</div>')
</div>
================================================
FILE: resources/views/list-group.blade.php
================================================
<ul class="list-group {{ $class ?? '' }}">
@isset($items)
@foreach($items as $item)
<li class="list-group-item">{{ $item }}</li>
@endforeach
@endisset
{{ $slot }}
</ul>
================================================
FILE: resources/views/modal.blade.php
================================================
<div
class="modal {{ $animation ?? 'fade' }} {{ $class ?? '' }}"
id="{{ $id ?? 'modal' }}"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
@isset($title)
<div class="modal-header">
<h5 class="modal-title">{{ $title }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
@endisset
<div class="modal-body">
{{ $slot }}
</div>
@isset($footer)
<div class="modal-footer">
{{ $footer }}
</div>
@endisset
</div>
</div>
</div>
================================================
FILE: resources/views/pagination.blade.php
================================================
<nav aria-label="Page navigation">
<ul class="pagination {{ $class ?? '' }}">
{{ $slot }}
</ul>
</nav>
================================================
FILE: resources/views/progress.blade.php
================================================
<div class="progress">
<div
class="progress-bar {{ $class ?? '' }}"
role="progressbar"
style="width: {{ $value }}%"
aria-valuenow="{{ $value }}"
aria-valuemin="{{ $min ?? 0 }}"
aria-valuemax="{{ $max ?? 100 }}"
></div>
{{ $slot }}
</div>
================================================
FILE: resources/views/render/pagination.blade.php
================================================
<nav aria-label="Page navigation">
@php
$paginator = $paginator->toArray();
@endphp
<ul class="pagination {{ $class ?? '' }}">
@istrue($arrows)
<li class="page-item">
<a class="page-link" href="{{ $paginator['prev_page_url'] }}" aria-label="Previous">
<span aria-hidden="true">«</span>
<span class="sr-only">Previous</span>
</a>
</li>
@endistrue
@foreach($elements[0] as $page => $link)
<li class="page-item @if($paginator['current_page'] == $page) active @endif">
<a class="page-link" href="{{ $link }}">{!! $page !!}</a>
</li>
@endforeach
@istrue($arrows)
<li class="page-item">
<a class="page-link" href="{{ $paginator['next_page_url'] }}" aria-label="Next">
<span aria-hidden="true">»</span>
<span class="sr-only">Next</span>
</a>
</li>
@endistrue
</ul>
</nav>
================================================
FILE: resources/views/table.blade.php
================================================
<table class="table table-responsive {{ $class ?? '' }}">
{{ $slot }}
</table>
================================================
FILE: src/BootstrapComponentsClass.php
================================================
<?php
namespace Appstract\BootstrapComponents;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;
class BootstrapComponentsClass
{
/*
* Render pagination buttons
*
* @param $items
* @param int $page
* @param int $perPage
* @param $path
* @param array $componentOptions
*/
public function pagination($items, $page = 1, $perPage = 25, $path = '', array $componentOptions = [])
{
$items = $items instanceof Collection ? $items : Collection::make($items);
$paginator = (new LengthAwarePaginator($items, $items->count(), (int) $perPage, (int) $page))
->withPath($path);
return $paginator->render('bootstrap::render.pagination', $componentOptions);
}
}
================================================
FILE: src/BootstrapComponentsFacade.php
================================================
<?php
namespace Appstract\BootstrapComponents;
use Illuminate\Support\Facades\Facade;
class BootstrapComponentsFacade extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return BootstrapComponentsClass::class;
}
}
================================================
FILE: src/BootstrapComponentsServiceProvider.php
================================================
<?php
namespace Appstract\BootstrapComponents;
use Appstract\BladeDirectives\BladeDirectivesServiceProvider;
use Illuminate\Support\ServiceProvider;
class BootstrapComponentsServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*/
public function boot()
{
$this->loadViewsFrom(__DIR__.'/../resources/views', 'bootstrap');
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__.'/../resources/views' => resource_path('views/vendor/bootstrap'),
], 'views');
}
}
/**
* Register the application services.
*/
public function register()
{
$this->app->register(BladeDirectivesServiceProvider::class);
}
}
================================================
FILE: tests/ExampleTest.php
================================================
<?php
namespace Appstract\BootstrapComponents\Test;
class ExampleTest extends \PHPUnit_Framework_TestCase
{
/** @test */
public function true_is_true()
{
$this->assertTrue(true);
}
}
gitextract_3r_yz7i8/
├── .editorconfig
├── .gitattributes
├── .gitignore
├── .styleci.yml
├── .travis.yml
├── LICENSE.md
├── README.md
├── composer.json
├── phpunit.xml.dist
├── resources/
│ └── views/
│ ├── alert.blade.php
│ ├── badge.blade.php
│ ├── breadcrumb.blade.php
│ ├── button-group.blade.php
│ ├── card.blade.php
│ ├── carousel.blade.php
│ ├── figure.blade.php
│ ├── input-group.blade.php
│ ├── jumbotron.blade.php
│ ├── list-group.blade.php
│ ├── modal.blade.php
│ ├── pagination.blade.php
│ ├── progress.blade.php
│ ├── render/
│ │ └── pagination.blade.php
│ └── table.blade.php
├── src/
│ ├── BootstrapComponentsClass.php
│ ├── BootstrapComponentsFacade.php
│ └── BootstrapComponentsServiceProvider.php
└── tests/
└── ExampleTest.php
SYMBOL INDEX (9 symbols across 4 files)
FILE: src/BootstrapComponentsClass.php
class BootstrapComponentsClass (line 8) | class BootstrapComponentsClass
method pagination (line 19) | public function pagination($items, $page = 1, $perPage = 25, $path = '...
FILE: src/BootstrapComponentsFacade.php
class BootstrapComponentsFacade (line 7) | class BootstrapComponentsFacade extends Facade
method getFacadeAccessor (line 14) | protected static function getFacadeAccessor()
FILE: src/BootstrapComponentsServiceProvider.php
class BootstrapComponentsServiceProvider (line 8) | class BootstrapComponentsServiceProvider extends ServiceProvider
method boot (line 13) | public function boot()
method register (line 27) | public function register()
FILE: tests/ExampleTest.php
class ExampleTest (line 5) | class ExampleTest extends \PHPUnit_Framework_TestCase
method true_is_true (line 8) | public function true_is_true()
Condensed preview — 28 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (17K chars).
[
{
"path": ".editorconfig",
"chars": 312,
"preview": "; This file is for unifying the coding style for different editors and IDEs.\n; More information at http://editorconfig.o"
},
{
"path": ".gitattributes",
"chars": 327,
"preview": "# Path-based git attributes\n# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html\n\n# Ignore all test and"
},
{
"path": ".gitignore",
"chars": 168,
"preview": "# Crap\n*.log\n.sass-cache\n.Spotlight-V100\n.Trashes\n.DS_Store\n.DS_Store?\nehthumbs.db\nThumbs.db\n\n# IDE\n*.sublime-*\n*.idea\n."
},
{
"path": ".styleci.yml",
"chars": 66,
"preview": "preset: laravel\n\ndisabled:\n - single_class_element_per_statement\n"
},
{
"path": ".travis.yml",
"chars": 392,
"preview": "language: php\n\nphp:\n - 7.2\n - 7.3\n\nenv:\n - LARAVEL_VERSION=5.7.*\n - LARAVEL_VERSION=5.8.*\n - LARAVEL_VERSION=^6.0\n "
},
{
"path": "LICENSE.md",
"chars": 1105,
"preview": "# The MIT License (MIT)\n\nCopyright (c) Appstract\n\n> Permission is hereby granted, free of charge, to any person obtainin"
},
{
"path": "README.md",
"chars": 2077,
"preview": "# Laravel Bootstrap Components\n\n[\n <div class=\"card-header\">\n {!! $header"
},
{
"path": "resources/views/carousel.blade.php",
"chars": 1301,
"preview": "<div\n id=\"{{ $id ?? 'carousel' }}\"\n class=\"carousel slide {{ $class ?? '' }}\"\n data-ride=\"carousel\"\n>\n @istr"
},
{
"path": "resources/views/figure.blade.php",
"chars": 178,
"preview": "<figure class=\"figure {{ $class ?? '' }}\">\n {{ $slot }}\n\n @isset($caption)\n <figcaption class=\"figure-capti"
},
{
"path": "resources/views/input-group.blade.php",
"chars": 65,
"preview": "<div class=\"input-group {{ $class ?? '' }}\">\n\t{{ $slot }}\n</div>\n"
},
{
"path": "resources/views/jumbotron.blade.php",
"chars": 315,
"preview": "<div\n class=\"\n jumbotron\n {{ $class ?? '' }}\n @istrue($fullwidth, 'jumbotron-fluid')\n \"\n>\n "
},
{
"path": "resources/views/list-group.blade.php",
"chars": 210,
"preview": "<ul class=\"list-group {{ $class ?? '' }}\">\n @isset($items)\n @foreach($items as $item)\n <li class=\"l"
},
{
"path": "resources/views/modal.blade.php",
"chars": 822,
"preview": "<div\n class=\"modal {{ $animation ?? 'fade' }} {{ $class ?? '' }}\"\n id=\"{{ $id ?? 'modal' }}\"\n>\n <div class=\"mod"
},
{
"path": "resources/views/pagination.blade.php",
"chars": 119,
"preview": "<nav aria-label=\"Page navigation\">\n <ul class=\"pagination {{ $class ?? '' }}\">\n {{ $slot }}\n </ul>\n</nav>\n"
},
{
"path": "resources/views/progress.blade.php",
"chars": 299,
"preview": "<div class=\"progress\">\n <div\n class=\"progress-bar {{ $class ?? '' }}\"\n role=\"progressbar\"\n style"
},
{
"path": "resources/views/render/pagination.blade.php",
"chars": 1084,
"preview": "<nav aria-label=\"Page navigation\">\n @php\n $paginator = $paginator->toArray();\n @endphp\n\n <ul class=\"pagi"
},
{
"path": "resources/views/table.blade.php",
"chars": 83,
"preview": "<table class=\"table table-responsive {{ $class ?? '' }}\">\n {{ $slot }}\n</table>\n"
},
{
"path": "src/BootstrapComponentsClass.php",
"chars": 792,
"preview": "<?php\n\nnamespace Appstract\\BootstrapComponents;\n\nuse Illuminate\\Pagination\\LengthAwarePaginator;\nuse Illuminate\\Support\\"
},
{
"path": "src/BootstrapComponentsFacade.php",
"chars": 344,
"preview": "<?php\n\nnamespace Appstract\\BootstrapComponents;\n\nuse Illuminate\\Support\\Facades\\Facade;\n\nclass BootstrapComponentsFacade"
},
{
"path": "src/BootstrapComponentsServiceProvider.php",
"chars": 767,
"preview": "<?php\n\nnamespace Appstract\\BootstrapComponents;\n\nuse Appstract\\BladeDirectives\\BladeDirectivesServiceProvider;\nuse Illum"
},
{
"path": "tests/ExampleTest.php",
"chars": 209,
"preview": "<?php\n\nnamespace Appstract\\BootstrapComponents\\Test;\n\nclass ExampleTest extends \\PHPUnit_Framework_TestCase\n{\n /** @t"
}
]
About this extraction
This page contains the full source code of the appstract/laravel-bootstrap-components GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 28 files (14.5 KB), approximately 4.3k tokens, and a symbol index with 9 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.