mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-13 20:14:45 +00:00
Add users, teams, authentication, profile/login/register/navbar views
This commit is contained in:
1 parent
436d22e385
commit
e47d493776
36 files changed
+1106
-66
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\Team;
|
||||
use Livewire\Component;
|
||||
|
||||
class SwitchTeam extends Component
|
||||
{
|
||||
public function switch_to($team_id)
|
||||
{
|
||||
if (!auth()->user()->teams->contains($team_id)) {
|
||||
return;
|
||||
}
|
||||
$team_to_switch_to = Team::find($team_id);
|
||||
if (!$team_to_switch_to) {
|
||||
return;
|
||||
}
|
||||
session(['currentTeam' => $team_to_switch_to]);
|
||||
return redirect(request()->header('Referer'));
|
||||
}
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.switch-team');
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user