Files
construprogress/app/Livewire/Phases/PhaseProgress.php
T
Javier Braña 90630379fb chore: cleanup dead code + format with Pint
- Remove unused FeaturesController (empty stubs, no routes)
- Remove ConvertSpatialFile CLI command (unused; service used in LayerManager)
- Remove MigrateGeojsonToFeatures CLI command (one-shot migration, not referenced)
- Remove .claude/worktrees/ (11 old agent worktrees from June)
- Apply Laravel Pint formatting across 219 files (style only, no functional changes)

Tests: 101 passing (319 assertions)
API routes: unchanged (8 routes intact)
2026-08-28 13:04:28 +02:00

45 lines
1.0 KiB
PHP

<?php
namespace App\Livewire\Phases;
use App\Models\Phase;
use Livewire\Attributes\Layout;
use Livewire\Component;
#[Layout('layouts.app')]
class PhaseProgress extends Component
{
public Phase $phase;
public $progress;
public $comment = '';
public function mount(Phase $phase)
{
$this->phase = $phase->load('progressUpdates');
$this->progress = $phase->progress_percent;
}
public function updateProgressManual()
{
$this->validate(['progress' => 'required|integer|min:0|max:100']);
$this->phase->progress_percent = $this->progress;
$this->phase->save();
$this->phase->progressUpdates()->create([
'user_id' => auth()->id(),
'progress_percent' => $this->progress,
'comment' => $this->comment,
]);
$this->dispatch('progressUpdated', $this->phase->id, $this->progress);
session()->flash('message', 'Progreso actualizado');
}
public function render()
{
return view('livewire.phases.phase-progress');
}
}