1. Go to this page and download the library: Download jobilla/laravel-app-events 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/ */
jobilla / laravel-app-events example snippets
dispatch(new AppEvent('user.created', new User(['name' => $user->name])));
class RegisterUser
{
protected $registrator;
public function __construct(Registrator $registrator)
{
$this->registrator = $registrator;
}
public function handle(User $user)
{
$this->registrator->register(
$user->getName(),
$user->getEmail(),
);
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.