I think you should learn how to code, and then use AI as a tool, and not as a developer.
May 7, 2026
3
Level 8
Event-Driven Architecture, do I need it?
So am progressing with the website with the help of AI, and its telling me I should implement event driven architecture for my stock/ items page.
Reading through it, it looks pretty complicated. Here is a snippet of code.
<?php
namespace Modules\Inventory\Actions;
use Illuminate\Support\Facades\DB;
use Modules\Inventory\Models\InventoryItem;
use Modules\Inventory\Models\InventoryTransaction;
class AdjustInventoryStockAction
{
public function execute(
InventoryItem $item,
int $newQuantity,
string $type,
?string $reason = null,
?int $performedBy = null,
): InventoryItem {
return DB::transaction(function () use (
$item,
$newQuantity,
$type,
$reason,
$performedBy
) {
$before = $item->quantity;
$item->quantity = $newQuantity;
$item->save();
InventoryTransaction::create([
'inventory_item_id' => $item->id,
'type' => $type,
'quantity' => abs($newQuantity - $before),
'before_quantity' => $before,
'after_quantity' => $newQuantity,
'reason' => $reason,
'performed_by' => $performedBy,
]);
return $item->fresh();
});
}
}
app(AdjustInventoryStockAction::class)->execute(
item: $item,
newQuantity: $validated['quantity'],
type: 'adjustment',
reason: 'Manual inventory update',
performedBy: Auth::id(),
);
Should I bite the nail and continue down this road since it will eventually lead to a better product, or is AI leading me on a wild goose chance?
Please or to participate in this conversation.