Git Product home page Git Product logo

laravel-messenger's Introduction

Messenger for Laravel

Join the chat at https://gitter.im/GeneaLabs/laravel-messenger Travis SensioLabs Insight Scrutinizer Coveralls GitHub (pre-)release Packagist

Messenger for Laravel masthead image.

Goal

To provide a drop-in, application-wide alerting functionality to display various types of alerts and notifications to the user in response to their actions.

Prerequisites

  • Bootstrap 3 or 4
  • Laravel 5.5 or 5.6
  • PHP >= 7.1.3

Features

  • Feedback notifications in form of bootstrap alerts or modals.
  • Send notifications from facade, app IoC reference, or blade directive.
  • Display notification easily via a blade command.

Installation

composer require genealabs/laravel-messenger

Nothing else needs to be done, as the service provider and facades will be auto-loaded.

Configuration

If you need to make changes to the default configuration, run the following command to publish the configuration file config\genealabs-laravel-messenger.php:

php artisan messenger:publish --config

After that you can configure the configuration according to your needs:

/*
|--------------------------------------------------------------------------
| CSS Framework Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the CSS framework to be used by Messenger for
| Laravel. This allows you to switch or upgrade frameworks without
| having to recreate all your alerts.
|
| Available Settings: "bootstrap3", "bootstrap4"
|
*/

'framework' => 'bootstrap4',

/*
|--------------------------------------------------------------------------
| JavaScript Blade Section
|--------------------------------------------------------------------------
|
| Your layout blade template will need to have a section dedicated to
| inline JavaScript methods and commands that are injected by this
| package. This will eliminate conflicts with Vue, as well as
| making sure that JS is run after all deps are loaded.
|
*/

'javascript-blade-section' => 'js',

Usage

  1. Trigger an alert using either the facade/IoC helper, or a blade directive in another view:
// IoC helper:
app('messenger')->send('message', 'title', 'level', autoHide, 'framework');

// Facade:
Messenger::send('message', 'title', 'level', autoHide, 'framework');

// Blade directive:
@send ('message', 'title', 'level', autoHide, 'framework')
  1. Add the placeholder to your layout blade file:
<div class="container">

    @deliver

</div>

Parameters

message

string|required

The body of the message you want to deliver to your user. This may contain HTML. If you add links, be sure to add the appropriate classes for the framework you are using.

title

string | optional | default: ''

Title of the notification, will be inserted as an <h4> tag, can also include HTML. Again, keep in mind to add any framework-specific formatting yourself.

level

string | optional | default: 'info'

If provided, must be one of the following: 'info', 'success', 'warning', 'danger'.

autoHide

boolean | optional | default: false

Allows you to let the notification disappear automatically after 15 seconds. If autoHide is false, the user will be provided a close button in the alert.

framework

string | optional | default: 'bootstrap3'

Specify the framework you are using. Right now it only supports 'bootstrap3' or 'bootstrap4'.

type

string | optional | default: 'alert'

Invoke any of the available alert modes. Currently only supports 'alert' or 'modal'.

laravel-messenger's People

Contributors

mikebronner avatar mitchellklijs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-messenger's Issues

Dependabot can't resolve your PHP dependency files

Dependabot can't resolve your PHP dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - don't install illuminate/session 7.x-dev|don't install laravel/framework 8.x-dev
    - don't install illuminate/session v7.0.0|don't install laravel/framework 8.x-dev
    - don't install illuminate/session v7.0.1|don't install laravel/framework 8.x-dev
    - don't install illuminate/session v7.0.2|don't install laravel/framework 8.x-dev
    - laravel/laravel dev-develop requires laravel/framework ^8.0 -> satisfiable by laravel/framework[8.x-dev].
    - Installation request for laravel/laravel dev-develop@dev -> satisfiable by laravel/laravel[dev-develop].
    - Installation request for illuminate/session ^7.0 -> satisfiable by illuminate/session[7.x-dev, v7.0.0, v7.0.1, v7.0.2].

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

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.