erikgall / flash-alert
Full width VueJS flash alerts
Installs: 335
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 1
Language:CSS
Requires
- php: >=7.0.0
- laravel/framework: ~5.2
Requires (Dev)
- mockery/mockery: dev-master
- phpunit/phpunit: ~4.0
README
Requirements
- Laravel
- Laravel Elixir
- VueJS
- Laravel-Elixir-Vueify
Installation
- Run the following command from your project root:
composer require erikgall/flash-alert
- Add the following line to your service providers in your
config/app.php
file:
EGALL\FlashAlert\FlashAlertServiceProvider::class
- In the command line run the following command to publish the assets:
php artisan vendor:publish
- 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';
- Add the component to your VueJs components
new Vue({ el: '#app', components: { FlashAlert } });
- 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>
- 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";
- 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'); } }