PHPackages                             tjgazel/laravel-bs4-alert - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tjgazel/laravel-bs4-alert

ActivePackage[Utility &amp; Helpers](/categories/utility)

tjgazel/laravel-bs4-alert
=========================

Bootstrap 4 alerts for laravel 5.\*

v1.0.0(7y ago)096MITPHPPHP &gt;=5.4.0

Since May 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tjgazel/laravel-bs4-alert)[ Packagist](https://packagist.org/packages/tjgazel/laravel-bs4-alert)[ Docs](https://github.com/tjgazel/laravel-bs4-alert)[ RSS](/packages/tjgazel-laravel-bs4-alert/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Bootstrap 4 alerts for laravel 5.\*
===================================

[](#bootstrap-4-alerts-for-laravel-5)

[![Latest Stable Version](https://camo.githubusercontent.com/dd1bb755574c03134d75bc40b3babdeac560185a0d48b3303874e09ab0dc6532/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d6273342d616c6572742f762f737461626c65)](https://packagist.org/packages/tjgazel/laravel-bs4-alert)[![License](https://camo.githubusercontent.com/3d9e20b07c01817efab732589412138ac8c2bfb8d36f094c7b8810ca6f217973/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d6273342d616c6572742f6c6963656e7365)](https://github.com/tjgazel/laravel-bs4-alert/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/83bb93d738ba94349e3e6b0db47298b2d63b36b25c87a6046f122ab69b589921/68747470733a2f2f706f7365722e707567782e6f72672f746a67617a656c2f6c61726176656c2d6273342d616c6572742f646f776e6c6f616473)](https://packagist.org/packages/tjgazel/laravel-bs4-alert)

[![](bs4-alert.png)](bs4-alert.png)

- [Instalation](#instalation)
- [Usage](#usage)
- [Tanks](#tanks)

**Other packages:**

- [tjgazel/laravel-toastr](https://github.com/tjgazel/laravel-toastr) - Toastr notifications for laravel 5.\*
- [tjgazel/laravel-bs3-alert](https://github.com/tjgazel/laravel-bs3-alert) - Bootstrap 3 alerts for laravel 5.\*

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

[](#installation)

**1)** Run `composer require tjgazel/laravel-bs4-alert` to include this in your project.
`Laravel 5.5 or later` will automatically discover the provider and the alias.

**2)** *Optional:* Laravel 5.4 and below
Add `TJGazel\Bs4Alert\Bs4AlertServiceProvider::class` to `providers` in `config/app.php`
Add `'Bs4Alert' => TJGazel\Bs4Alert\Facades\Bs4Alert::class` to `aliases` in `config/app.php`.

```
// config/app.php
'providers' => [
  // ...
  TJGazel\Bs4Alert\Bs4AlertServiceProvider::class,
],

'aliases' => [
  // ...
  'Bs4Alert' => TJGazel\Bs4Alert\Facades\Bs4Alert::class,
],

```

**3)** Run `php artisan vendor:publish --provider="TJGazel\Bs4Alert\Bs4AlertServiceProvider" --tag="config"`to publish the config file in `config/bs4-alert.php`.

**4)** Include `@include('bs4-alert::template')` somewhere in your template..

```

        @include('bs4-alert::template')

            @yield('content')

```

**5)** *Optional:* Run `php artisan vendor:publish --provider="TJGazel\Bs4Alert\Bs4AlertServiceProvider" --tag="template"`to publish the template view.
Modify the published template located at `resources/views/vendor/bs4-alert/template.php` to your liking.

```
@if(session()->has(config()->get('bs4-alert.session_name')))
  @foreach(session()->get(config()->get('bs4-alert.session_name')) as $bs4Alert)

        &times;

      @if($bs4Alert['title'])
        {!! $bs4Alert['title'] !!}
      @endif
      @foreach($bs4Alert['messages'] as $bs4AlertMessage)
        {!! $bs4AlertMessage !!}
      @endforeach

  @endforeach
@endif

```

**6)** *Optional:* Modify the publish configuration file locate at `config/bs4-alert.php` to your liking.

```
