@extends('layouts.setup') @section('title', '初期設定') @php // 目的(できること)ごとに、必要な設定をまとめる。 $groups = [ [ 'title' => 'monakaを使い始めるには', 'goal' => 'ページ作成・配信', 'accent' => 'blue', 'icon' => 'bi-rocket-takeoff', 'optional' => false, 'items' => [ ['name' => '会社情報', 'desc' => '会社名・住所・連絡先を登録します', 'route' => route('setting.business'), 'card' => $companyCard], ], ], [ 'title' => 'メール配信を使うには', 'goal' => 'メール配信', 'accent' => 'blue', 'icon' => 'bi-envelope', 'optional' => false, 'items' => [ ['name' => 'メール送信用ドメイン', 'desc' => 'メールの送信元ドメインを設定します(迷惑メール対策)', 'route' => route('setting.mail-domain'), 'card' => $mailSendingDomainCard], ['name' => 'メール設定', 'desc' => '配信用の送信元(自分)を登録します', 'route' => route('account.index', ['setup_channel' => 'mail']), 'card' => $mailSetupCard], ], ], [ 'title' => 'LINE配信を使うには', 'goal' => 'LINE配信', 'accent' => 'green', 'icon' => 'bi-chat-dots', 'optional' => false, 'items' => [ ['name' => 'LINE設定', 'desc' => '公式アカウントと連携するための設定です', 'route' => route('account.index', ['setup_channel' => 'line']), 'card' => $lineSetupCard], ], ], [ 'title' => '商品を販売するには', 'goal' => '商品販売', 'accent' => 'amber', 'icon' => 'bi-box-seam', 'optional' => false, 'items' => [ ['name' => '決済連携', 'desc' => 'クレジットカード決済の接続をします', 'route' => route('setting.payment'), 'card' => $paymentSetupCard], ['name' => '商品登録', 'desc' => '売る商品と価格を登録します', 'route' => route('setting.products'), 'card' => $productSetupCard], ], ], [ 'title' => 'その他の設定(任意)', 'goal' => null, 'accent' => 'gray', 'icon' => 'bi-gear', 'optional' => true, 'items' => [ ['name' => '独自ドメイン', 'desc' => '公開ページのURLを自分のドメインにできます', 'route' => route('setting.domain'), 'card' => $domainCard], ['name' => '通知設定', 'desc' => '申込やエラーをChatworkで受け取れます', 'route' => route('setting.notification'), 'card' => $notificationCard], ['name' => 'オペレーター管理', 'desc' => 'スタッフ用のログインと権限を設定します', 'route' => route('setting.operator'), 'card' => $operatorCard], ], ], ]; @endphp @section('setup_body')
@foreach($groups as $g) @php $total = count($g['items']); $done = collect($g['items'])->filter(fn ($it) => ($it['card']['variant'] ?? '') === 'done')->count(); $remaining = $total - $done; $firstTodo = collect($g['items'])->first(fn ($it) => ($it['card']['variant'] ?? '') !== 'done'); @endphp

{{ $g['title'] }}

@if($g['optional']) 任意 @elseif($remaining === 0) 設定済み @else {{ $total }}つの設定が必要です @endif
@if(! $g['optional'] && $total >= 2)

番号の順(①→②)に設定してください。

@endif @foreach($g['items'] as $i => $it) @php $isDone = ($it['card']['variant'] ?? '') === 'done'; @endphp
{{ $i + 1 }}
{{ $it['name'] }}
{{ $it['desc'] }}
{{ $it['card']['label'] }} {{ $isDone ? '設定を確認' : '設定する' }}
@endforeach @if(! $g['optional']) @php $footColor = $g['accent'] === 'green' ? 'green' : ($g['accent'] === 'amber' ? 'amber' : 'blue'); @endphp
@if($remaining === 0) 設定完了。{{ $g['goal'] }}を利用できます。 @else あと{{ $remaining }}つの設定で{{ $g['goal'] }}を利用できます {{ $done > 0 ? '設定を続ける' : '設定する' }} @endif
@endif
@endforeach
@endsection