1. Go to this page and download the library: Download fullstack/inbounder 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/ */
fullstack / inbounder example snippets
use Inbounder\Models\EmailTemplate;
$template = EmailTemplate::create([
'name' => 'Welcome Email',
'slug' => 'welcome-email',
'subject' => 'Welcome to {{company}}!',
'html_content' => '<h1>Welcome {{name}}!</h1><p>Thank you for joining {{company}}.</p>',
'text_content' => 'Welcome {{name}}! Thank you for joining {{company}}.',
'variables' => ['name', 'company'],
'is_active' => true,
]);
// Using Gates
Gate::define('send-email', function ($user) {
return $user->hasPermission('send-email');
});
// Using Policies
class UserPolicy
{
public function sendEmail(User $user): bool
{
return $user->hasPermission('send-email');
}
}
// Using Spatie Permissions
$user->givePermissionTo('send email');
use Inbounder\Events\EmailTemplateCreated;
use Inbounder\Events\DistributionListCreated;
Event::listen(EmailTemplateCreated::class, function ($event) {
Log::info('Email template created', [
'template_id' => $event->getTemplateId(),
'template_name' => $event->getTemplateName(),
]);
});
Event::listen(DistributionListCreated::class, function ($event) {
Log::info('Distribution list created', [
'list_id' => $event->getListId(),
'list_name' => $event->getListName(),
]);
});