@php $rows = $lineFriendsRows ?? collect(); $scenarioLabelRows = $scenarioLabelRows ?? collect(); $qName = (string) ($lineFriendsNameQuery ?? ''); $qLabel = (string) ($lineFriendsLabelQuery ?? ''); $labelSuggestions = $lineFriendsLabelSuggestions ?? collect(); $registeredLabelKeysJson = $scenarioLabelRows ->map(fn ($r) => mb_strtolower(trim((string) ($r['name'] ?? '')))) ->filter() ->values(); $tz = config('app.timezone', 'Asia/Tokyo'); $chipClasses = [ 'chip-a', 'chip-b', 'chip-c', 'chip-d', 'chip-e', 'chip-f', ]; @endphp @push('styles') @endpush @include('account.scenario.partials._line_webhook_delivery_alert', ['lineAccount' => $lineAccount ?? null])

LINE友だち

@csrf
@php $officialFollowers = isset($lineAccount) && $lineAccount instanceof \App\Models\DeliveryAccount ? $lineAccount->line_followers_count : null; $friendsRowCount = ($lineFriendsRows ?? collect())->count(); @endphp @if($officialFollowers !== null && (int) $officialFollowers > 0 && $friendsRowCount === 0) @endif

LINE 公式にいる友だちを monaka に取り込めます(上のボタン、または LINE設定の STEP 3 確認時)。Webhook だけ来ていて読者に未登録の友だちでも、ラベル編集・配信切替をすると読者が自動で作成されます。

ラベル名を毎回思い出さなくてよいよう、ラベル設定でこのシナリオ用の一覧を登録できます。候補ボタンでは登録名が先頭に出ます。
表示条件
@foreach($labelSuggestions as $suggestion) @endforeach
@if($qName !== '' || $qLabel !== '') 解除 @endif
@if($labelSuggestions->isNotEmpty())
よく使うラベル
@foreach($labelSuggestions->take(10) as $suggestion) @endforeach
@endif
友だち一覧
@forelse($rows as $row) @php $isSubscriberActive = ($row['subscriber_status'] ?? null) === 'active'; @endphp @empty @endforelse
LINE登録名 ステータス ラベル 登録経路 登録日
@if(!empty($row['avatar_url'])) @else 👤 @endif
{{ $row['display_name'] }}
{{ $row['line_user_id'] }}
{{ $isSubscriberActive ? '配信対象' : '配信除外' }}
{{ $row['status_text'] }}
@if(!empty($row['labels']) && is_array($row['labels'])) @foreach($row['labels'] as $label) @php $hash = crc32((string) $label); $class = $chipClasses[abs((int) $hash) % count($chipClasses)]; @endphp {{ $label }} @endforeach @else @endif {{ $row['registration_route'] }} @if($row['registered_at']) {{ $row['registered_at']->timezone($tz)->format('Y-m-d H:i:s') }} @else — @endif
該当する友だちがありません。
@push('scripts') @endpush