PHP code example of grantholle / reaction

1. Go to this page and download the library: Download grantholle/reaction library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

grantholle / reaction example snippets


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

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();

// 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();

...