-
app/Http/Controllers/Setting/TeamMemberController.php
Open in GitHubuse App\Http\Requests\TeamMember\UpdateUserRoleRequest; use Illuminate\Database\Eloquent\Builder; use App\Models\User; class TeamMemberController extends Controller { // ... public function updateUserRole($id, UpdateUserRoleRequest $request) { $user = User::where('id', $id) ->whereHas('workspaces', function (Builder $query) { $query->where('workspaces.id', auth()->user()->currentWorkspace->id); }) ->firstOrFail(); // ... } // ... }