mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
38 lines
784 B
PHP
38 lines
784 B
PHP
<?php
|
|
|
|
namespace App\Http\Livewire\Projects;
|
|
|
|
use App\Traits\HasToast;
|
|
use App\Traits\RefreshComponentOnBroadcast;
|
|
use Illuminate\Contracts\View\View;
|
|
use Livewire\Component;
|
|
|
|
class CreateProject extends Component
|
|
{
|
|
use HasToast;
|
|
use RefreshComponentOnBroadcast;
|
|
|
|
public bool $open = false;
|
|
|
|
public array $inputs = [];
|
|
|
|
public function create(): void
|
|
{
|
|
app(\App\Actions\Projects\CreateProject::class)
|
|
->create(auth()->user(), $this->inputs);
|
|
|
|
$this->dispatch('$refresh')->to(ProjectsList::class);
|
|
|
|
$this->dispatch('created');
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
if (request()->query('create')) {
|
|
$this->open = true;
|
|
}
|
|
|
|
return view('livewire.projects.create-project');
|
|
}
|
|
}
|