123456789101112131415161718192021 |
- <?php
- namespace App\Services\History\Converter;
- use App\Models\User;
- class WhitelistConverter implements ConverterContact
- {
- public function handle(mixed $value)
- {
- $ids = array_filter(explode(",", $value));
- if (! $ids) {
- return null;
- }
- $users = User::query()->whereIn("id", $ids)->pluck("name");
- return $users ? implode(",", $users->toArray()) : null;
- }
- }
|