• Stars
    star
    135
  • Rank 269,297 (Top 6 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Notifying your users doesn't have to be a lot of work.

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'.

More Repositories

1

laravel-model-caching

Eloquent model-caching made easy.
PHP
2,246
star
2

laravel-caffeine

Keeping Your Laravel Forms Awake.
PHP
921
star
3

laravel-sign-in-with-apple

Provide "Sign In With Apple" functionality to your Laravel app.
PHP
443
star
4

laravel-governor

Manage authorization with granular role-based permissions in your Laravel Apps.
PHP
183
star
5

nova-map-marker-field

Provides an visual interface for editing latitude and longitude coordinates.
Vue
131
star
6

laravel-mixpanel

Intuitive drop-in analytics.
PHP
117
star
7

laravel-pivot-events

PHP
114
star
8

nova-gutenberg

Implementation of the Gutenberg editor as a Laravel Nova Field based on Laraberg.
Vue
107
star
9

laravel-socialiter

Automatically manage user persistence and resolution for any Laravel Socialite provider.
PHP
101
star
10

laravel-casts

Form builder for Laravel.
PHP
93
star
11

laravel-maps

Easy - peasy - maps for Laravel
PHP
81
star
12

laravel-overridable-model

Provide a uniform method of allowing models to be overridden in Laravel.
PHP
63
star
13

nova-file-upload-field

The easiest drag-and-drop file uploading field for Laravel Nova.
Vue
53
star
14

laravel-multi-step-progressbar

Quickly implement a multi-step progress-bar in Laravel.
PHP
45
star
15

laravel-impersonator

Package to allow user-impersonation in your Laravel and Nova apps.
PHP
45
star
16

laravel-optimized-postgres

Implement all textual fields as `text` in Postgres databases.
PHP
41
star
17

laravel-null-carbon

Carbon null-class.
PHP
39
star
18

nova-prepopulate-searchable

A tool to allow BelongsTo searchable fields to be pre-populated with data
Vue
37
star
19

laravel-changelog

Easily integrate and display your changelog in your app.
PHP
37
star
20

laravel-appleseed

Prevent the pesky Apple Touch Icon error log entries.
PHP
30
star
21

Phpgmaps

Larvel 5 implementation of BIOSTALL/CodeIgniter-Google-Maps-V3-API-Library.
PHP
27
star
22

nova-passport-manager

Manage Passport clients and tokens from within Nova.
Vue
26
star
23

nova-multi-tenant-manager

Manage tenants and their settings in Laravel Nova.
Vue
21
star
24

interesting-packages-and-articles

List of packages and articles we are interested in using that fulfill specific needs.
17
star
25

nova-telescope

Integrate Laravel Telescope into Laravel Nova.
PHP
17
star
26

tailwind-mac-colors

Color palette and swatches for macOS's color picker.
16
star
27

php-coding-standards

Custom PHPCS sniffs that support all our coding standards.
Shell
15
star
28

action-reviewdog-phpstan

🐾 Run PHPStan with ReviewDog.
Shell
12
star
29

nova-horizon

Integrate Laravel Horizon into Laravel Nova.
PHP
10
star
30

laravel-registrar

PHP
9
star
31

laravel-tawk

Easily and quickly integrate Tawk.to LiveChat into your laravel app in under 5 minutes!
PHP
8
star
32

tailwindcss-sketch-design-system

An atomic design system for TailwindCSS implemented in Sketch.
CSS
8
star
33

cashier-paypal

Laravel Cashier-compatible billing for PayPal
PHP
7
star
34

panic-nova-intelephense.novaextension

JavaScript
6
star
35

laravel-dev-environment

A collection of scripts and tutorials to optimize your Laravel development environment.
Shell
6
star
36

laravel-imagery

Serve contextually optimized images to speed up page rendering and improve the user experience!
PHP
6
star
37

laravel-authorization-addons

Additional helper methods and blade directives to help with more complex authorization queries.
PHP
6
star
38

action-reviewdog-phpmd

🐾 Run PHP Mess Detector with ReviewDog.
Shell
5
star
39

awesome-laravel-ignition-plugins

A curated list of plugins for the Laravel Igniter error package.
5
star
40

documentation

Documentation for all our open-source packages.
CSS
4
star
41

laravel-cashier-braintree

PHP
4
star
42

laravel-whoops-atom

Open Whoops Stack Trace Files in Atom Editor.
PHP
3
star
43

laravel-codespaces-app-template

Template for creating Laravel apps in codespaces.
PHP
3
star
44

action-reviewdog-phpcs

Shell
3
star
45

bootstrap-css-grid-override

Update bootstrap 4 with native CSS-grid with graceful degradation.
CSS
3
star
46

credo

My beliefs on being.
2
star
47

SculptKeyboardMapping

Keyboard mapping for Microsoft Sculpt Keyboard on Mac using KeyRemap4MacBook
2
star
48

panic-nova-phpcs.novaextension

JavaScript
2
star
49

laravel-codespaces-package-template

Template for creating Laravel packages in codespaces.
PHP
2
star
50

bones-macros

useful form macros for Laravel's Blade template engine.
PHP
2
star
51

laravel-nova-morph-many-to-one

Drop-in package that adds a many-to-one (inverse of one-to-many) polymorphic relationship to Eloquent and Nova.
PHP
2
star
52

laravel-collection-macros

PHP
2
star
53

unity-heraldry-generator

Heraldic Generator created in Unity using C# with the goal of providing a common web and in-game mechanism for creating Coats of Arms.
C#
1
star
54

laravel-multi-tenant-manager

PHP
1
star
55

panic-nova-phpmd.novaextension

JavaScript
1
star
56

panic-nova-atom-keybindings

1
star
57

nova-prepopulate-searchable-old

A tool to allow BelongsTo searchable fields to be pre-populated with data.
Vue
1
star
58

laravel-two-way-attribute-casting

Perform attribute casting when saving Eloquent models to the database.
PHP
1
star