coolify/app/Http/Livewire/Project/Edit.php

27 lines
540 B
PHP
Raw Normal View History

2023-06-22 09:33:26 +02:00
<?php
namespace App\Http\Livewire\Project;
use App\Models\Project;
use Livewire\Component;
class Edit extends Component
{
public Project $project;
protected $rules = [
'project.name' => 'required|min:3|max:255',
'project.description' => 'nullable|string|max:255',
];
2023-06-22 15:25:57 +02:00
2023-06-22 09:33:26 +02:00
public function submit()
{
$this->validate();
try {
$this->project->save();
$this->emit('saved');
2023-09-11 17:36:30 +02:00
} catch (\Throwable $e) {
return handleError($e, $this);
2023-06-22 09:33:26 +02:00
}
}
}