@extends('layouts.app') @section('title', $course->name . ' — コース基本設定') @section('page-title', $course->name) @section('page-subtitle-heading', '【この画面でできること】') @section('page-subtitle') コース名・種類・サムネイル・受講スタイル・公開期間・オファーなどをまとめて設定します。レッスン共通の既定(公開状態・ボタン文言・コメント)は「レッスン基本設定」にまとめています。 @endsection @section('content') @php $cs = $courseSettings ?? \App\Support\BundleCourseSettings::merge(is_array($course->course_settings) ? $course->course_settings : null); $basic = $cs['basic'] ?? []; $offers = $cs['offers'] ?? []; $automation = $cs['automation'] ?? []; $lessonsDefaults = $cs['lessons'] ?? []; $comments = $cs['comments'] ?? []; $val = fn (string $path, mixed $default = '') => old($path, data_get($cs, str_replace('course_settings.', '', $path), $default)); $releaseStartMode = old('course_settings.automation.release_start_mode', $automation['release_start_mode'] ?? 'on_grant'); $releaseEndMode = old('course_settings.automation.release_end_mode', $automation['release_end_mode'] ?? 'none'); $releaseStartAt = old('course_settings.automation.release_start_at', $automation['release_start_at'] ?? ''); $releaseEndAt = old('course_settings.automation.release_end_at', $automation['release_end_at'] ?? ''); $buttonTextMode = old('course_settings.basic.button_text_mode', $basic['button_text_mode'] ?? 'default'); if (! in_array($buttonTextMode, ['default', 'custom'], true)) { $legacyBtn = (string) ($basic['button_text'] ?? 'start'); $buttonTextMode = ($legacyBtn === 'start' || $legacyBtn === '') ? 'default' : 'custom'; } $buttonTextCustom = old('course_settings.basic.button_text_custom', $basic['button_text_custom'] ?? ''); $courseCategoryOptions = $courseCategoryOptions ?? \App\Support\MembershipSiteCourseCategories::optionsForSelect($site->course_categories); $selectedCourseCategoryId = old('course_settings.basic.course_category_id', $basic['course_category_id'] ?? ''); $learningStyleSequentialLabel = '受講完了にすると次のレッスンが受講可能'; if ($releaseStartAt && str_contains((string) $releaseStartAt, ' ')) { $releaseStartAt = str_replace(' ', 'T', substr((string) $releaseStartAt, 0, 16)); } if ($releaseEndAt && str_contains((string) $releaseEndAt, ' ')) { $releaseEndAt = str_replace(' ', 'T', substr((string) $releaseEndAt, 0, 16)); } @endphp @include('site.course.partials._workspace_toolbar') @php $copySourceCourses = $copySourceCourses ?? collect(); @endphp @if($copySourceCourses->isNotEmpty())

同じサイト内の別コースから、受講スタイル・オファー・レッスン既定などをまとめてコピーできます(コース名・サムネイルは変わりません)。

@csrf
@include('site.course.partials._copy_course_settings_field', [ 'copySourceCourses' => $copySourceCourses, 'fieldName' => 'copy_settings_from_course_id', 'allowEmptyOption' => false, ])
@error('copy_settings_from_course_id')
{{ $message }}
@enderror
@endif
@csrf @method('PUT')
基本設定
@component('site.course.partials._settings_form_row', ['label' => 'コース名', 'required' => true]) @error('name')
{{ $message }}
@enderror @endcomponent @component('site.course.partials._settings_form_row', ['label' => '管理名称', 'hint' => '受講生には表示されません。管理画面での識別用です。']) @endcomponent @component('site.course.partials._settings_form_row', ['label' => '種類']) @endcomponent @component('site.course.partials._settings_form_row', ['label' => 'コース画像', 'hint' => '16:9推奨(png / jpg / gif / webp・最大5MB)。プレビューは管理のコース一覧カードと同じ比率・切り抜きです。']) @include('partials._image_file_upload', [ 'inputId' => 'course-settings-thumbnail-file', 'previewId' => 'course-settings-thumbnail-preview', 'label' => '', 'layout' => 'featured', 'currentUrl' => old('thumbnail_media_url') ?: $course->thumbnail_url, 'showRemove' => (bool) $course->thumbnail_url, 'removeCheckboxId' => 'course-settings-thumbnail-remove', ]) @endcomponent @component('site.course.partials._settings_form_row', ['label' => 'コース一覧のボタン', 'hint' => '会員のコース一覧・コースの結合内一覧で「受講する」等に使う文言です。レッスン本文下・受講完了ボタンとは別(レッスン基本設定)。']) @endcomponent @component('site.course.partials._settings_form_row', ['label' => '進捗率', 'hint' => '会員のコース画面に、受講完了したレッスン数/公開レッスン数(%)を表示します。未完了のレッスンは進捗に含めません。'])
@endcomponent @component('site.course.partials._settings_form_row', ['label' => '動画自動再生/視聴完了設定', 'hint' => 'オンにすると、レッスン設定の動画オプションが会員画面に反映されます。下の「自動化設定」で受講スタイルを「'.$learningStyleSequentialLabel.'」にしたとき、HTML5動画はその下の視聴率に達すると自動で受講完了になります(YouTube/Vimeoは受講完了ボタン)。'])
@endcomponent @component('site.course.partials._settings_form_row', ['label' => 'カテゴリ', 'hint' => 'サイト設定で登録したカテゴリから選びます。未設定の場合は絞り込み対象になりません。']) @if(count($courseCategoryOptions) > 0) @else

このサイトにはまだカテゴリがありません。

サイト設定でカテゴリを登録 @endif @endcomponent @component('site.course.partials._settings_form_row', ['label' => 'ステータス', 'required' => true]) @error('status')
{{ $message }}
@enderror @endcomponent @component('site.course.partials._settings_form_row', ['label' => 'コース一覧での表示順']) @error('sort_order')
{{ $message }}
@enderror @endcomponent @component('site.course.partials._settings_form_row', ['label' => '説明(任意)']) @error('description')
{{ $message }}
@enderror @endcomponent
@php $defaultLessonStatus = old('course_settings.lessons.default_status', $lessonsDefaults['default_status'] ?? 'published'); $completionButtonLabel = old('course_settings.lessons.completion_button_label', $lessonsDefaults['completion_button_label'] ?? \App\Support\BundleCourseSettings::DEFAULT_COMPLETION_BUTTON_LABEL); $completionAfterAction = old('course_settings.lessons.completion_after_action', $lessonsDefaults['completion_after_action'] ?? \App\Support\BundleCourseSettings::DEFAULT_COMPLETION_AFTER_ACTION); $commentsMode = old('course_settings.comments.mode', $comments['mode'] ?? 'disabled'); @endphp
レッスン基本設定

このコースで新規にレッスンを追加するときの初期値と、会員のレッスン画面で共通して使う設定です。各レッスンの編集画面で個別に上書きできます。

本文下の任意ボタン(課題提出リンクなど)は各レッスンの編集で設定します。ここではコース共通の項目だけを登録します。

@component('site.course.partials._settings_form_row', ['label' => '新規レッスンの既定の公開状態', 'hint' => 'レッスン追加画面を開いたとき、公開状態の初期選択です。']) @endcomponent @component('site.course.partials._settings_form_row', ['label' => '受講完了ボタンの文言', 'hint' => '生徒が受講を完了したことを登録するボタンです。会員のレッスン画面(本文の下)に常に表示されます。次のレッスンを完了までロックするには、下の「自動化設定」→ 受講スタイルで「'.$learningStyleSequentialLabel.'」を選びます。']) @endcomponent @component('site.course.partials._settings_form_row', ['label' => '受講完了ボタンを押した後', 'hint' => '会員が受講完了ボタンを押したあとの画面遷移です。'])
@endcomponent
@component('site.course.partials._settings_form_row', ['label' => 'コメント機能'])

「レッスンごと」は各レッスンの編集画面でコメントをオンにしたレッスンのみ受講生が投稿できます。

投稿の確認・返信は コース設定 → コメント から行います。

@endcomponent @component('site.course.partials._settings_form_row', ['label' => '返信時の表示名(既定)'])

運営返信の名前の初期値です。各コメントの返信フォームで変更できます。

@endcomponent @component('site.course.partials._settings_form_row', ['label' => 'コメント承認'])

オンにすると、受講生の投稿はコース設定 → コメントで「会員に表示」をオンにするまで非公開です。

@endcomponent
@php $offerMode = old('course_settings.offers.offer_mode', \App\Support\BundleCourseSettings::resolveOfferMode($offers)); $offerLimitedStart = old('course_settings.offers.limited_start_at', $offers['limited_start_at'] ?? ''); $offerLimitedEnd = old('course_settings.offers.limited_end_at', $offers['limited_end_at'] ?? ''); if (is_string($offerLimitedStart) && str_contains($offerLimitedStart, ' ')) { $offerLimitedStart = str_replace(' ', 'T', substr($offerLimitedStart, 0, 16)); } if (is_string($offerLimitedEnd) && str_contains($offerLimitedEnd, ' ')) { $offerLimitedEnd = str_replace(' ', 'T', substr($offerLimitedEnd, 0, 16)); } @endphp
未購入者へのオファー設定

ログイン済みでこのコースをまだ付与されていない会員に、マイページのコース一覧で表示します。付与済みの会員には従来どおり「受講する」等が表示されます。

@component('site.course.partials._settings_form_row', ['label' => 'オファー表示'])
@endcomponent @component('site.course.partials._settings_form_row', ['label' => '未購入時のボタン'])

未付与の会員に表示するボタン文言(既定: 詳細)。

@endcomponent @component('site.course.partials._settings_form_row', ['label' => 'オファー先URL', 'hint' => '購入ページ・申込フォームなど。未設定の場合、未購入ボタンは押せません。']) @endcomponent
受講完了しないと次に進めない設定は、この下の 自動化設定 → 受講スタイル で行います(基本設定の上では選べません)。
自動化設定
@php $audienceMode = old('course_settings.automation.audience_mode', \App\Support\BundleCourseSettings::resolveAudienceMode($automation)); $audienceDays = old('course_settings.automation.audience_days_after_grant', $automation['audience_days_after_grant'] ?? 0); $selectedLabelIds = old('course_settings.automation.audience_label_ids', $automation['audience_label_ids'] ?? []); if (! is_array($selectedLabelIds)) { $selectedLabelIds = []; } $siteLabelOptions = $siteLabelOptions ?? collect(); @endphp @component('site.course.partials._settings_form_row', ['label' => '受講対象者'])

コースを付与されている受講生は、常に閲覧できます。

指定期間が経過したあとに、コースを開放できます。

日後から開放

コース(またはコースの結合)を付与した日の0時から数えます。

コースを付与されている受講生のうち、ラベルが割り当てられている受講生だけが閲覧できます。

@if($siteLabelOptions->isEmpty())

ラベルが未登録です。ラベル設定で追加し、受講生管理で受講生に付与してください。

@else

対象にするラベル(いずれか1つ以上付いている受講生が閲覧できます)

@foreach($siteLabelOptions as $labelOpt)
id, array_map('intval', $selectedLabelIds), true))>
@endforeach
@endif
@endcomponent @php $learningStyle = old('course_settings.automation.learning_style', $automation['learning_style'] ?? 'all_unlocked'); $videoCompletionPercent = old('course_settings.automation.video_completion_percent', $automation['video_completion_percent'] ?? 90); @endphp @component('site.course.partials._settings_form_row', ['label' => '受講スタイル', 'hint' => '「受講完了で次を解放」と案内されている場合は、下の2つ目の選択肢です。'])

ドリップ日数・公開日時の条件を満たせば、順番に関係なくレッスンを開けます。

前のレッスンを「受講完了」にした受講生だけ、次のレッスンが解放されます。動画は視聴率が基準に達すると自動完了(HTML5動画)できます。

%以上
@endcomponent @component('site.course.partials._settings_form_row', ['label' => '開放日(開始日)'])
日後
か月後
@endcomponent @component('site.course.partials._settings_form_row', ['label' => '締め切り(終了日)'])
日後に終了
@endcomponent @component('site.course.partials._settings_form_row', ['label' => '受講停止時の動作', 'badge' => '準備中'])

受講停止の自動判定は未接続です。設定値のみ保存されます。

@endcomponent
コースの削除

このコースと配下のレッスン・グループを削除します。このコースだけを含むコースの結合への受講生付与も解除されます。元に戻せません。

@csrf @method('DELETE')
@include('partials.monaka_image_picker') @push('scripts') @endpush @endsection