2017 © Pedro Peláez
 

library reaction

Get a reaction in Laravel 5

image

grantholle/reaction

Get a reaction in Laravel 5

  • Saturday, July 15, 2017
  • by grantholle
  • Repository
  • 1 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Reaction

Generates a reaction based on a type of event (positive, bad, unsafe), (*1)

Installation

Include this package via Composer..., (*2)

composer require grantholle/reaction

Add the service provider in config/app.php..., (*3)

'providers' => [
  ...
  Some\Kind\Of\ReactionServiceProvider::class
  ...
];

Usage

Simply use the react() helper function to generate a random reaction. I like to pair it with Laracast's Flash package for easy, fun flash messaging., (*4)

react('positive'); // <strong>Boom!</strong>
react('bad'); // <strong>Yikes!</strong>
react('unsafe'); // <strong>Heads up!</strong>

// Using chaining
react()->positive(); // <strong>Great!</strong>
react()->bad(); // <strong>Darn!</strong>
react()->unsafe(); // <strong>Easy!</strong>

// Don't wrap it in <strong/>
react('positive', false);
react(null, false)->positive();

💯, (*5)

// A controller function, for example
public function update(Request $request, Model $model)
{
  $model->update($request->all());
  $message = react()->positive() . ' The model has been updated successfully.';
  // <strong>Super!</strong> The model has been updated successfully.

  flash($message)->success();

...

The Versions

15/07 2017

dev-master

9999999-dev

Get a reaction in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package

15/07 2017

1.2

1.2.0.0

Get a reaction in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package

15/07 2017

1.1

1.1.0.0

Get a reaction in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package

14/07 2017

1.0

1.0.0.0

Get a reaction in Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package