1. Go to this page and download the library: Download magdicom/laravel-hooks 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/ */
magdicom / laravel-hooks example snippets
use Magdicom\LaravelHooks\Facade\Hooks;
Hooks::register("HookName", function($vars){}, 1);
# Register our functions
Hooks::register("Greetings", function($vars){
return "Hi There,";
}, 1);
Hooks::register("Greetings", function($vars){
return "This is the second line of greetings!";
}, 2);
# Later we run it
echo Hooks::all("Greetings")->toString("<br>");