erikgall/flash-alert

There is no license information available for the latest version (v1.0.2) of this package.

Full width VueJS flash alerts

v1.0.2 2016-06-28 21:33 UTC

This package is auto-updated.

Last update: 2024-11-15 16:49:53 UTC


README

Requirements

  1. Laravel
  2. Laravel Elixir
  3. VueJS
  4. Laravel-Elixir-Vueify

Installation

  1. Run the following command from your project root:

composer require erikgall/flash-alert

  1. Add the following line to your service providers in your config/app.php file:

EGALL\FlashAlert\FlashAlertServiceProvider::class

  1. In the command line run the following command to publish the assets:

php artisan vendor:publish

  1. Import the component like such (assuming your are inside your main app.js located at resources/assets/js):
 import FlashAlert from './components/flash-alert.vue';
  1. Add the component to your VueJs components
new Vue({
    el: '#app',
    components: {
        FlashAlert
    }
});
  1. Add the following line to your main blade layout file. This line must be wrapped in a div#app
<div id="app">
    @include('vendor.flash.alert')
</div>
  1. Add the sass file to your main app.sass file:
@import "vendor/alert";
// For animations the package includes a sass copy of animate.css
@import "vendor/animate";
  1. Run gulp

Usage

The easiest way to use the package is in your controller like so:

class AuthController extends Controller {

    public function login() {

        // Login Success
        alert()->success('You have been successfully signed in.')->autohide(4000);

        return redirect()->to('/users');

    }

}