fixes
This commit is contained in:
35
app/Http/Livewire/Profile/Form.php
Normal file
35
app/Http/Livewire/Profile/Form.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,9 +72,4 @@ class Deploy extends Component
|
||||
$this->application->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function pollingStatus()
|
||||
{
|
||||
$this->application->refresh();
|
||||
}
|
||||
}
|
||||
|
||||
15
app/Http/Livewire/Project/Application/Status.php
Normal file
15
app/Http/Livewire/Project/Application/Status.php
Normal 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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user