I'm not exaggerating when I say AI changed how I write code.
Not because it writes everything for me — but because it eliminates the parts of coding that used to slow me down the most: staring at boilerplate, Googling the same errors, writing repetitive tests, and trying to understand unfamiliar concepts from scratch.
I use four tools daily: GitHub Copilot, ChatGPT, Claude, and Cursor. Each one has a specific role in my workflow. Here's exactly how I use them — with before/after examples.
1. Writing Boilerplate Code — GitHub Copilot
Boilerplate is the biggest time thief in any project. Form requests, controllers, service classes, migrations — it's all necessary but mentally draining to write from scratch.
GitHub Copilot handles this inside my editor before I even finish typing.
Before AI
Writing a Laravel form request used to look like this: open a new file, remember the method names, type out every rule manually, look up validation syntax I half-remember…
// I'd write this entirely by hand — slowly
class StorePaymentRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'amount' => 'required|numeric|min:1',
'reference' => 'required|string|max:100',
'gateway' => 'required|in:ozow,yoco',
];
}
}
After AI (Copilot)
Now I just type the class name and a comment describing what I want:
// Form request for processing a payment — amount, reference, gateway
class StorePaymentRequest extends FormRequest
{
// Copilot fills in the rest instantly ✅
Copilot suggests the full class — rules, messages, even custom error messages — based on context from the rest of my project. I review, adjust, and move on in seconds.
2. Debugging Errors — ChatGPT
When I hit an error I don't immediately understand, ChatGPT is the first place I go. Not Stack Overflow. Not Google.
I paste the error + the relevant code and ask: "What's causing this and how do I fix it?"
Before AI
SQLSTATE[42S22]: Column not found: 1054 Unknown column
'payments.user_id' in 'where clause'
I'd spend 10–20 minutes checking migrations, re-reading docs, and Googling the exact error hoping someone had the same setup.
After AI (ChatGPT)
I paste the error with my model and migration, and get a precise explanation back:
"Your
paymentstable migration doesn't include auser_idcolumn, but your Eloquent model has abelongsTo(User::class)relationship that's trying to query it. Add the column to your migration or check that you're running the latest migration."
// Fix: add this to your payments migration
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
What used to take 20 minutes now takes 2. The difference isn't just speed — it's that I understand why something broke, not just how to patch it.
3. Writing Tests — Claude
Writing tests is something most developers know they should do more of — and don't, because it's time-consuming and repetitive.
I use Claude specifically for test generation because it's excellent at understanding context across a whole file and writing thorough, meaningful tests.
Before AI
Writing a test for a payment controller meant manually thinking through every scenario:
// I'd write one test, maybe two, and move on
public function test_payment_is_processed_successfully()
{
$response = $this->post('/pay', ['amount' => 100, 'gateway' => 'yoco']);
$response->assertRedirect('/success');
}
After AI (Claude)
I paste my controller and ask: "Write PHPUnit tests for this controller covering success, failure, validation errors, and invalid gateway."
// Claude generates full coverage automatically
public function test_payment_succeeds_with_valid_data()
{
$response = $this->post('/pay', [
'amount' => 500,
'reference' => 'INV-001',
'gateway' => 'yoco',
]);
$response->assertRedirect(route('payment.success'));
$this->assertDatabaseHas('payments', ['reference' => 'INV-001', 'status' => 'paid']);
}
public function test_payment_fails_validation_without_amount()
{
$response = $this->post('/pay', ['gateway' => 'yoco']);
$response->assertSessionHasErrors(['amount']);
}
public function test_payment_rejects_invalid_gateway()
{
$response = $this->post('/pay', ['amount' => 100, 'gateway' => 'stripe']);
$response->assertSessionHasErrors(['gateway']);
}
public function test_payment_handles_gateway_failure_gracefully()
{
Http::fake([
'online.yoco.com/*' => Http::response(['error' => 'Declined'], 400),
]);
$response = $this->post('/pay', [
'amount' => 100,
'reference' => 'INV-002',
'gateway' => 'yoco',
]);
$response->assertRedirect(route('payment.error'));
}
Four solid tests in under a minute. Before AI, I might have written one and told myself I'd come back to it.
4. Understanding New Concepts — Cursor + ChatGPT
Instead of reading through entire documentation pages, I use Cursor (which has AI built directly into the editor) to explain code inline, and ChatGPT to teach me concepts with examples tailored to my stack.
After AI (ChatGPT)
I asked: "Explain Laravel Pipeline to me like I'm a developer who knows Laravel but has never used Pipeline. Show me a real example using payment processing."
// ChatGPT explained it with an example I could use directly
$result = app(Pipeline::class)
->send($paymentData)
->through([
ValidatePaymentData::class,
CheckForDuplicateTransaction::class,
ChargeGateway::class,
SendConfirmationEmail::class,
])
->thenReturn();
Understanding that took me 5 minutes instead of 45.
Cursor — Inline Code Explanation
When I open an unfamiliar file, I highlight confusing code in Cursor and ask it to explain inline:
// I highlighted this line and asked Cursor: "what does this do?"
$order->loadMissing(['payments' => fn($q) => $q->where('status', 'paid')]);
// Cursor explained:
// "loadMissing() lazy-loads the 'payments' relationship only if it hasn't
// been loaded already. The closure filters it to only load paid payments,
// preventing unnecessary queries if the relation is already in memory."
No context switching. No browser tabs. The explanation comes to where I'm working.
How These Tools Fit Together
| Task | Tool | Role |
|---|---|---|
| Boilerplate | GitHub Copilot | Generating code & scaffolding |
| Debugging | ChatGPT | Quick fixes & error explanations |
| Testing | Claude | Deep logic & edge case coverage |
| Inline Help | Cursor | Understanding existing code |
| Learning | ChatGPT | Learning new concepts deeply |
⚠️ The One Thing to Remember
AI makes you faster, not infallible.
I've had Copilot suggest code that looked right but had a subtle security flaw. I've had ChatGPT confidently give me outdated API syntax. Always review what AI generates — especially anything touching security, payments, or data.
Use it as a fast, knowledgeable pair programmer — not as the final word.
Final Thoughts
If you're not using AI in your development workflow yet, you're spending time you don't need to spend.
The developers who will stand out in the next few years aren't the ones who avoid AI. They're the ones who know how to use it well.
💬 Working on an app and need help?
I specialize in Laravel applications, API integrations, and payment gateway setups (Ozow, Yoco, and more).
Top comments (0)