PHP code example of dakshraman / laravel-ai-debugger
1. Go to this page and download the library: Download dakshraman/laravel-ai-debugger 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/ */
use Illuminate\Support\Facades\Log;
public function register(): void
{
$this->app->reportable(function (\Throwable $e) {
Log::info('AI Debug Analysis', app('ai-debugger')->analyze($e->getMessage()));
});
}
use Dakshraman\AIDebugger\AI\AIInterface;
class MyCustomDriver implements AIInterface
{
public function analyze(string $input): string
{
// Call your AI tool and return the response string
return shell_exec('echo ' . escapeshellarg($input) . ' | my-ai-tool');
}
}
bash
php artisan vendor:publish --tag=config
bash
php artisan debug:analyze
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.