1. Go to this page and download the library: Download mydnic/laravel-kustomer 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/ */
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Mydnic\Volet\Features\FeedbackMessages;
use Mydnic\Volet\Features\FeatureManager;
class VoletServiceProvider extends ServiceProvider
{
public function boot(FeatureManager $volet): void
{
// Register and configure the Feedback Messages feature
$this->registerFeedbackMessagesFeature($volet);
// Example of registering a custom feature
// $volet->register(new YourCustomFeature());
}
private function registerFeedbackMessagesFeature(FeatureManager $volet): void
{
$volet->register(
(new FeedbackMessages)
// Configure feature display
->setLabel('Send us feedback')
->setIcon('https://api.iconify.design/lucide:message-square.svg?color=%23888888')
// Add feedback categories
->addCategory(
slug: 'general',
name: 'General Feedback',
icon: 'https://api.iconify.design/lucide:smile.svg?color=%23888888'
)
->addCategory(
slug: 'improvement',
name: 'Improvement',
icon: 'https://api.iconify.design/lucide:lightbulb.svg?color=%23888888'
)
->addCategory(
slug: 'bug',
name: 'Bug Report',
icon: 'https://api.iconify.design/lucide:bug.svg?color=%23888888'
)
);
}
}
namespace App\Volet\Features;
use Mydnic\Volet\Features\BaseFeature;
class CustomFeature extends BaseFeature
{
public function getId(): string
{
return 'custom-chatbot';
}
public function getLabel(): string
{
return 'Talk with our chatbot';
}
public function getIcon(): string
{
return 'https://api.iconify.design/lucide:star.svg?color=%23888888';
}
public function getComponentName(): ?string
{
return 'custom-feature'; // Name of your Web Component
}
public function getScripts(): ?string
{
$scriptUrl = asset('volet-custom-feature.js');
return "<script src=\"{$scriptUrl}\"></script>";
}
public function getConfig(): array
{
return [
'routes' => [
'store' => route('custom-feature.store'),
],
'labels' => [
'placeholder' => 'Enter your message...',
'button' => 'Submit',
'success' => 'Thank you!',
],
// Add any other configuration your component needs
];
}
}
(new FeedbackMessages())->disable(); // or ->enable()
namespace App\Observers;
use Mydnic\Volet\Models\FeedbackMessage;
use App\Notifications\NewFeedbackMessageNotification;
use Illuminate\Support\Facades\Notification;
class FeedbackMessageObserver
{
public function created(FeedbackMessage $feedbackMessage)
{
// Send notification to administrators
Notification::route('mail', '[email protected]')
->notify(new NewFeedbackMessageNotification($feedbackMessage));
}
}
// Register the observer in your AppServiceProvider
public function boot()
{
FeedbackMessage::observe(FeedbackMessageObserver::class);
}