Level 2
I should have used $this->id yea it is what I intended. Now everything is peachy.
Text::make(__('Mobile'), 'mobile')
->canSeeWhen($this->id, $request->user()->id),
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Trying to make a field only visible to the requested user For Index Quary for the user its like this it works fine
else{
return $query->where('id', $request->user()->id)
}
Here is the field in User Resource
Text::make(__('Mobile'), 'mobile')
->canSee(function ($request) {
return Auth::user()->id == $request->user()->id; })
I also tried
Text::make(__('Mobile'), 'mobile')
->canSeeWhen('id', $request->user()->id),
It doesn't hide at all if the user has view-any-user permission and is viewing another user. Basically everyone can see the mobile field
I should have used $this->id yea it is what I intended. Now everything is peachy.
Text::make(__('Mobile'), 'mobile')
->canSeeWhen($this->id, $request->user()->id),
Please or to participate in this conversation.