mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 02:24:11 -05:00
Move V5 source, migrations, UI, scripts, and tests into documentation, then remove V5 routes, models, jobs, configuration, dependencies, and application hooks.
23 lines
528 B
Plaintext
23 lines
528 B
Plaintext
<?php
|
|
|
|
namespace App\Http\Controllers\V5\Concerns;
|
|
|
|
use App\Models\Team;
|
|
use Illuminate\Http\Request;
|
|
|
|
trait ResolvesCurrentTeam
|
|
{
|
|
/**
|
|
* Resolve the current team set by the EnsureCurrentTeam middleware, or
|
|
* abort with a 404 so resources outside the team stay invisible.
|
|
*/
|
|
protected function currentTeamOrFail(Request $request): Team
|
|
{
|
|
$currentTeam = $request->attributes->get('v5.currentTeam');
|
|
|
|
abort_unless($currentTeam instanceof Team, 404);
|
|
|
|
return $currentTeam;
|
|
}
|
|
}
|