1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Services\History\Converter;
- use App\Models\User;
- class WhitelistConverter extends EagerLoadingConverter 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;
- }
- public static function eagerLoad(array $items): void
- {
- }
- }
|