separate route permission + token manage

This commit is contained in:
xiaomlove
2025-04-17 18:59:03 +07:00
parent 263901bc54
commit 432c57f886
27 changed files with 203 additions and 54 deletions

View File

@@ -2,7 +2,9 @@
namespace App\Http\Resources;
use App\Auth\Permission;
use Illuminate\Http\Resources\Json\JsonResource;
use Illuminate\Support\Facades\Gate;
class UserResource extends JsonResource
{
@@ -18,7 +20,7 @@ class UserResource extends JsonResource
$out = [
'id' => $this->id,
'username' => $this->username,
'email' => $this->email,
'email' => $this->when(Gate::allows("viewEmail", $this->resource), $this->email),
'status' => $this->status,
'enabled' => $this->enabled,
'added' => format_datetime($this->added),