rector: arrrrr
This commit is contained in:
@@ -4,7 +4,9 @@ namespace App\Livewire\SharedVariables\Environment;
|
||||
|
||||
use App\Models\Application;
|
||||
use App\Models\Project;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
use Throwable;
|
||||
|
||||
class Show extends Component
|
||||
{
|
||||
@@ -23,7 +25,7 @@ class Show extends Component
|
||||
try {
|
||||
$found = $this->environment->environment_variables()->where('key', $data['key'])->first();
|
||||
if ($found) {
|
||||
throw new \Exception('Variable already exists.');
|
||||
throw new Exception('Variable already exists.');
|
||||
}
|
||||
$this->environment->environment_variables()->create([
|
||||
'key' => $data['key'],
|
||||
@@ -34,9 +36,11 @@ class Show extends Component
|
||||
'team_id' => currentTeam()->id,
|
||||
]);
|
||||
$this->environment->refresh();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function mount()
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
namespace App\Livewire\SharedVariables\Project;
|
||||
|
||||
use App\Models\Project;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
use Throwable;
|
||||
|
||||
class Show extends Component
|
||||
{
|
||||
@@ -16,7 +18,7 @@ class Show extends Component
|
||||
try {
|
||||
$found = $this->project->environment_variables()->where('key', $data['key'])->first();
|
||||
if ($found) {
|
||||
throw new \Exception('Variable already exists.');
|
||||
throw new Exception('Variable already exists.');
|
||||
}
|
||||
$this->project->environment_variables()->create([
|
||||
'key' => $data['key'],
|
||||
@@ -27,20 +29,24 @@ class Show extends Component
|
||||
'team_id' => currentTeam()->id,
|
||||
]);
|
||||
$this->project->refresh();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$projectUuid = request()->route('project_uuid');
|
||||
$teamId = currentTeam()->id;
|
||||
$project = Project::where('team_id', $teamId)->where('uuid', $projectUuid)->first();
|
||||
$project = Project::query()->where('team_id', $teamId)->where('uuid', $projectUuid)->first();
|
||||
if (! $project) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
$this->project = $project;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
namespace App\Livewire\SharedVariables\Team;
|
||||
|
||||
use App\Models\Team;
|
||||
use Exception;
|
||||
use Livewire\Component;
|
||||
use Throwable;
|
||||
|
||||
class Index extends Component
|
||||
{
|
||||
@@ -16,7 +18,7 @@ class Index extends Component
|
||||
try {
|
||||
$found = $this->team->environment_variables()->where('key', $data['key'])->first();
|
||||
if ($found) {
|
||||
throw new \Exception('Variable already exists.');
|
||||
throw new Exception('Variable already exists.');
|
||||
}
|
||||
$this->team->environment_variables()->create([
|
||||
'key' => $data['key'],
|
||||
@@ -27,9 +29,11 @@ class Index extends Component
|
||||
'team_id' => currentTeam()->id,
|
||||
]);
|
||||
$this->team->refresh();
|
||||
} catch (\Throwable $e) {
|
||||
} catch (Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function mount()
|
||||
|
||||
Reference in New Issue
Block a user