1. Go to this page and download the library: Download chijioke-ibekwe/raven 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/ */
// config/notification-contexts.php
return [
'user-verified' => [
'description' => 'Notification to inform a user that they have been verified on the platform',
'email_template_id' => env('TEMPLATE_USER_VERIFIED', 'd-ad34ghAwe3mQRvb29'),
'channels' => ['email'],
'active' => true,
],
];
// config/notification-contexts.php
return [
'user-verified' => [
'description' => 'Notification to inform a user that they have been verified on the platform',
'email_template_filename' => 'user-verified.html',
'email_subject' => 'Welcome, {{name}}! Your account has been verified',
'channels' => ['email'],
'active' => true,
],
];
// config/notification-contexts.php
return [
'user-verified' => [
'description' => 'Notification to inform a user that they have been verified on the platform',
'sms_template_filename' => 'user-verified.txt',
'channels' => ['sms'],
'active' => true,
],
];
// config/notification-contexts.php
return [
'user-verified' => [
'description' => 'Notification to inform a user that they have been verified on the platform',
'in_app_template_filename' => 'user-verified.json',
'channels' => ['database'],
'active' => true,
],
];
// config/notification-contexts.php
return [
'user-verified' => [
'description' => 'Notification to inform a user that they have been verified on the platform',
'email_template_id' => env('TEMPLATE_USER_VERIFIED', 'd-ad34ghAwe3mQRvb29'),
'sms_template_filename' => 'user-verified.txt',
'in_app_template_filename' => 'user-verified.json',
'channels' => ['email', 'sms', 'database'],
'active' => true,
],
];
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable;
public function routeNotificationForMail()
{
return $this->email_address;
}
}
$scroll = Scroll::make()
->for('user-verified')
->to($user)
->channels(['email']) // only send email, even if context defines sms and database too
->with(['name' => $user->name]);
Raven::dispatch($scroll);