مؤشرات التقدم:
شريط تقدم بسيط
public int $progress = 0;
public function processItems()
{
$items = Item::all();
$total = $items->count();
foreach ($items as $index => $item) {
$item->process();
$this->progress = (($index + 1) / $total) * 100;
}
}العرض
<div class="progress-bar" style="width: {{ $progress }}%"></div>
<span>{{ $progress }}%</span>
<button wire:click="processItems">
<span wire:loading.remove>ابدأ</span>
<span wire:loading>جاري المعالجة...</span>
</button>مع الخطوات
public int $currentStep = 1;
public int $totalSteps = 5;