This commit is contained in:
Andras Bacsai
2023-05-22 22:30:33 +02:00
parent a044354294
commit c023fdae8b
30 changed files with 251 additions and 243 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Http\Livewire\Profile;
use App\Models\User;
use Livewire\Component;
class Form extends Component
{
public int $userId;
public string $name;
public string $email;
protected $rules = [
'name' => 'required',
];
public function mount()
{
$this->userId = auth()->user()->id;
$this->name = auth()->user()->name;
$this->email = auth()->user()->email;
}
public function submit()
{
try {
$this->validate();
User::where('id', $this->userId)->update([
'name' => $this->name,
]);
} catch (\Throwable $error) {
return generalErrorHandler($error, $this);
}
}
}

View File

@@ -72,9 +72,4 @@ class Deploy extends Component
$this->application->save();
}
}
public function pollingStatus()
{
$this->application->refresh();
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace App\Http\Livewire\Project\Application;
use App\Models\Application;
use Livewire\Component;
class Status extends Component
{
public Application $application;
public function pollingStatus()
{
$this->application->refresh();
}
}

View File

@@ -74,15 +74,14 @@ class User extends Authenticatable
public function otherTeams()
{
$team_id = data_get(session('currentTeam'), 'id');
$team_id = session('currentTeam')->id;
return auth()->user()->teams->filter(function ($team) use ($team_id) {
return $team->id != $team_id;
});
}
public function resources()
{
$team_id = data_get(session('currentTeam'), 'id');
$team_id = session('currentTeam')->id;
$data = Application::where('team_id', $team_id)->get();
return $data;
}