36 lines
1.3 KiB
PHP
36 lines
1.3 KiB
PHP
@extends('admin.layout')
|
|
|
|
@php $editing = isset($board) && $board; @endphp
|
|
|
|
@section('title', $editing ? '编辑版块' : '新建版块')
|
|
@section('page-title', $editing ? '编辑版块' : '新建版块')
|
|
|
|
@section('content')
|
|
<form method="POST" action="{{ $editing ? route('admin.forum.boards.update', $board) : route('admin.forum.boards.store') }}" class="form-card">
|
|
@csrf
|
|
@if ($editing) @method('PUT') @endif
|
|
|
|
<div class="field">
|
|
<label>名称</label>
|
|
<input name="name" class="input" value="{{ old('name', $board?->name ?? '') }}" required>
|
|
</div>
|
|
<div class="field">
|
|
<label>Slug</label>
|
|
<input name="slug" class="input" value="{{ old('slug', $board?->slug ?? '') }}" required>
|
|
</div>
|
|
<div class="field">
|
|
<label>描述</label>
|
|
<textarea name="description" class="textarea">{{ old('description', $board?->description ?? '') }}</textarea>
|
|
</div>
|
|
<div class="field">
|
|
<label>排序</label>
|
|
<input type="number" name="sort" class="input" value="{{ old('sort', $board?->sort ?? 0) }}">
|
|
</div>
|
|
|
|
<div class="form-actions">
|
|
<button class="btn btn-primary">保存</button>
|
|
<a href="{{ route('admin.forum.boards.index') }}" class="btn">取消</a>
|
|
</div>
|
|
</form>
|
|
@endsection
|