coolify/app/Livewire/Project/New/EmptyProject.php

26 lines
656 B
PHP
Raw Permalink Normal View History

<?php
2023-12-07 18:06:32 +00:00
namespace App\Livewire\Project\New;
use App\Models\Project;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Livewire\Component;
class EmptyProject extends Component
{
use AuthorizesRequests;
public function createEmptyProject()
{
$this->authorize('create', Project::class);
$project = Project::create([
2023-05-24 12:26:50 +00:00
'name' => generate_random_name(),
2023-08-22 15:44:49 +00:00
'team_id' => currentTeam()->id,
'uuid' => new_public_id(),
]);
2024-06-10 20:43:34 +00:00
return redirectRoute($this, 'project.show', ['project_uuid' => $project->uuid, 'environment_uuid' => $project->environments->first()->uuid]);
}
}