:::

4-2 /resources/views/exam/create.blade.php

@extends('layouts.app') 

@section('content')
    <h1>建立測驗</h1>

    @can('建立測驗')
        @if(isset($exam))
            {{ bs()->openForm('patch', "/exam/{$exam->id}", ['model' => $exam]) }}
        @else
            {{ bs()->openForm('post', '/exam') }}
        @endif

            {{ bs()->formGroup()
                ->label('測驗標題', false, 'text-sm-right')
                ->control(bs()->text('title')->placeholder('請填入測驗標題'))
                ->showAsRow() }}

            {{-- {{ bs()->select('enable', ['1' => '開啟', '0' => '關閉'], '1') }} --}}
            {{-- {{ bs()->checkbox('enable1')->description('啟用測驗')->checked() }} --}}
            
            {{ bs()->formGroup()
                ->label('是否啟用', false, 'text-sm-right')
                ->control(bs()->radioGroup('enable', [1 => '啟用', 0 => '關閉'])
                ->inline())
                ->showAsRow() }}

            {{ bs()->hidden('user_id', Auth::id()) }}

            {{ bs()->formGroup()
                ->label('', false, 'text-sm-right')
                ->control(bs()->submit('儲存'))
                ->showAsRow() }}

        {{ bs()->closeForm() }}
    @else    
        {{-- 
        @component('bs::alert', ['type' => 'danger'])
            @slot('heading')
                沒有操作的權限
            @endslot
            <p>請先登入,或有相關權限者始能建立測驗</p>
        @endcomponent 
        --}}

        <div class="alert alert-danger">
            <h2>沒有操作的權限</h2>
            <p>請先登入,或有相關權限者始能建立測驗</p>
        </div>
    @endcan
    
@endsection

 


:::

書籍目錄

展開 | 闔起

快速登入


https%3A%2F%2Fcampus-xoops.tn.edu.tw%2Fmodules%2Ftad_book3%2Fpage.php%3Ftbdsn%3D1308%26tbsn%3D41

計數器

今天: 7886788678867886
昨天: 2489248924892489
總計: 8029868802986880298688029868802986880298688029868