Skip to content

Commit

Permalink
Update TeamController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo authored Jun 26, 2024
1 parent d746b36 commit 5ddfd30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion stubs/navigation/app/Http/Controllers/TeamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ class TeamController extends Controller
/**
* Show the team management screen.
*
* @param \Illuminate\Http\Request $request
* @param int $teamId
* @return \Illuminate\View\View
*/
public function show(Request $request, $team)
{
$team = Jetstream::newTeamModel()->where('uuid', $team)->firstOrFail();
$team = Jetstream::newTeamModel()->where('uuid',$team)->firstOrFail();

if (Gate::denies('view', $team)) {
abort(403);
}

if ($team->uuid != $request->user()->currentTeam->uuid) {
return redirect()->route('teams.show', $request->user()->currentTeam->uuid);
}

return view('teams.show', [
'user' => $request->user(),
'team' => $team,
Expand Down

0 comments on commit 5ddfd30

Please sign in to comment.