PHP code example of opensynergic / hooks

1. Go to this page and download the library: Download opensynergic/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/ */

    

opensynergic / hooks example snippets


use OpenSynergic\Hooks\Facades\Hook;

Hook::call('user_created', $user);

namespace App\Providers;

use Illuminate\Support\ServiceProvider;
use OpenSynergic\Hooks\Facades\Hook;
use App\Models\User;

class AppServiceProvider extends ServiceProvider
{
    //...

    public function boot(): void
    {
      Hook::register('user_created', function($hookName, User $arguments){
        $arguments->sendEmailVerificationNotification();
      });
    }

}