While working on https://whatthediff.ai/?utm_campaign=beyondcode&utm_source=blog - an AI powered code review assistant (written in PHP with Laravel) I learned a lot about OpenAI and how to come up with good prompts. Among other things, I demoed how you can make use of the OpenAI API and use it to try and provide solutions for your Laravel and PHP exceptions.

In order to make API calls to OpenAI, you will need to https://platform.openai.com/ and create an API key.

Now all you need to do is add your OpenAI API key to your.env file: Adding solutions to Ignition

public function getSolutionTitle(): string { return 'AI Generated Solution'; } public function getSolutionDescription(): string { return $this->solution; } public function getDocumentationLinks(): array { return []; }
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners