1. Go to this page and download the library: Download empire2/gaze-ghostwriter 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/ */
empire2 / gaze-ghostwriter example snippets
'enabled' => env('GHOSTWRITER_ENABLED', true),
'gaze_enabled' => env('GHOSTWRITER_GAZE_ENABLED', false), // PII boundary on/off
'user_model' => \App\Models\User::class, // Host User model
'layout' => 'components.layouts.app', // Blade layout for admin pages
'middleware' => ['web', 'auth'], // Add 'role:admin' etc. here
'route_prefix' => 'ghostwriter',
use Empire2\GazeGhostwriter\Concerns\HasGhostwriterUserData;
class User extends Authenticatable
{
use HasGhostwriterUserData;
// ...
}
use Empire2\GazeGhostwriter\Jobs\ProcessGhostwriterInboxJob;
use Empire2\GazeGhostwriter\Services\DraftGeneratorService;
use Empire2\GazeGhostwriter\Models\SupportMailMessage;
// 1. Pull new mail and generate drafts (production: enqueue on a schedule).
ProcessGhostwriterInboxJob::dispatch();
// 2. Generate a draft for a single message ad-hoc.
$service = app(DraftGeneratorService::class);
$draft = $service->generateForMessage(SupportMailMessage::find($id));
bash
php artisan ghostwriter:imap-test # verify IMAP credentials, list folders
php artisan ghostwriter:reprocess-html-bodies # rebuild plain text from HTML bodies
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.