Initial commit - construprogress app

This commit is contained in:
2026-05-07 23:31:33 +02:00
commit 156aa14bbb
157 changed files with 21654 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
namespace App\Livewire;
use Livewire\Component;
use App\Models\Phase;
class PhaseProgress extends Component
{
public Phase $phase;
public $progress;
public $comment = '';
public function mount(Phase $phase)
{
$this->phase = $phase;
$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.phase-progress');
}
}