Fun With OpenAI and Laravel
In this series, you'll get your feet wet with a variety of fun examples that demonstrate how to interact with OpenAI using PHP and Laravel. We'll begin by assuming that you know nothing, and then slowly work our way up one episode at a time!
Series episodes
Chatting With OpenAI (7)
Hello, AI
8m 33sGet started with OpenAI in Laravel by sending POST requests to generate AI poems. Learn to handle JSON responses and display dynamic AI content on your web page.
Keep the Conversation Going
14m 51sLearn how to keep OpenAI conversations flowing by storing message history and using a Chat class to manage context for smarter, seamless AI interactions.
Chat with AI From the Command Line
16m 24sEnhance your Chat class with openai-php/laravel and create an Artisan command to chat with OpenAI directly from the terminal for seamless AI interaction.
Ask AI to Speak. Boom, Roasted!
15m 10sLearn how to use OpenAI to turn text into sarcastic spoken audio with a fun form that roasts any topic you submit. Engage your app with AI-powered voice!
AI-Generated Images
22m 36sExplore how to generate AI images with OpenAI by merging prompts, refining ideas, and creating stunning visuals to enhance your Laravel projects effortlessly.
Use AI to Detect Comment Spam
10m 29sLearn how to use OpenAI to detect comment spam by formatting AI responses as JSON, keeping your forum clean and improving user experience effortlessly.
Place OpenAI Call Within a Validation Rule Class
11m 38sOrganize your spam checking by moving the OpenAI call into a dedicated validation rule class, making your Laravel code cleaner and easier to maintain. (157 characters) Let me know if you'd like it refined!
Create Your Own Assistant (3)
Feed OpenAI Your Docs
16m 38sLearn how to feed OpenAI your Markdown docs using the Assistants API, enabling AI assistants to help users understand your Composer package effortlessly. (157 characters) Let me know if you'd like it refined!
Refactor Procedural Code Into Behaviors
22m 4sLearn how to refactor procedural code into a clean, simple API with behaviors that improve readability and maintainability. Simplify your code today! (157 characters)
Bonus: Polymorphic AI
23m 13sDiscover how to build flexible AI integrations by extracting OpenAI code into a class and using interfaces for easy service swapping. (156 characters)




