Skip to content

Commit

Permalink
Create TeamController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
inmanturbo authored Jun 24, 2024
1 parent ea216e9 commit 917eebf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions stubs/navigation/app/Http/Controllers/TeamController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Gate;
use Laravel\Jetstream\Jetstream;

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, $teamUUID)
{
$team = Jetstream::newTeamModel()->where('uuid',$teamUUID)->firstOrFail();

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

return view('teams.show', [
'user' => $request->user(),
'team' => $team,
]);
}
}

0 comments on commit 917eebf

Please sign in to comment.