Git Product home page Git Product logo

bones-flash's Introduction

Build Status Latest Stable Version Latest Unstable Version License

Laravel Bones Flash Notification (bones-flash)

Installation

To install bones-flash as a stand-alone module:

composer require genealabs/bones-flash:*

or add it to you composer.json file:

    "require": {
        /* ... */,
        "genealabs/bones-flash": "*"
    },
    /* ... */

And then add the service provider to your app.php config file:

	// 'providers' => array(
		'GeneaLabs\Bones\Flash\BonesFlashServiceProvider',
    // );

Usage

You can add any one of the following alerts anywhere in your app. Most common-place is probably the controller or global.php (for error catching).

use GeneaLabs\Bones\Flash\Flash;

class MyController extends BaseController
{
	public function index()
	{
		Flash::info("test");

		return View::make('index');
	}
}

And include it in your index.blade.php where you would like the notification to appear:

@include('bones-flash::bones.flash')

or:

App::error(function(Exception $exception, $code)
{
    Flash::danger("An error occurred");
	Log::error($exception);
	View::make('my.view');
});

Methods

The following methods are available to use:

// shows a bootstrap success message
Flash::success($message);

// shows a bootstrap info message
Flash::info($message);

// shows a bootstrap warning message
Flash::warning($message);

// shows a bootstrap danger message
Flash::danger($message);

// shows a message in a bootstrap modal window
Flash::modal($message);

Dependencies

At this time this package requires:

  • Laravel 5.0+
  • Bootstrap 3.1+
  • jQuery 1.7+

bones-flash's People

Contributors

mikebronner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.