52 lines
2.6 KiB
PHP
Executable File
52 lines
2.6 KiB
PHP
Executable File
@extends('layouts.app')
|
|
|
|
@section('header', 'Novo Template')
|
|
|
|
@section('breadcrumbs')
|
|
@php
|
|
$breadcrumbs = [
|
|
'Templates' => route('prompt-templates.index'),
|
|
'Novo' => null
|
|
];
|
|
@endphp
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="card shadow mb-4">
|
|
<div class="card-header py-3">
|
|
<h6 class="m-0 fw-bold text-primary">Cadastrar Template</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="POST" action="{{ route('prompt-templates.store') }}">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="name" class="form-label">Nome</label>
|
|
<input type="text" class="form-control" id="name" name="name" value="{{ old('name') }}" required>
|
|
@error('name') <div class="text-danger small">{{ $message }}</div> @enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="description" class="form-label">Descrição</label>
|
|
<textarea class="form-control" id="description" name="description" rows="2">{{ old('description') }}</textarea>
|
|
@error('description') <div class="text-danger small">{{ $message }}</div> @enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="category" class="form-label">Categoria</label>
|
|
<input type="text" class="form-control" id="category" name="category" value="{{ old('category') }}">
|
|
@error('category') <div class="text-danger small">{{ $message }}</div> @enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="template_data" class="form-label">Dados do Template (JSON)</label>
|
|
<textarea class="form-control font-monospace" id="template_data" name="template_data" rows="20" required>{{ old('template_data') }}</textarea>
|
|
@error('template_data') <div class="text-danger small">{{ $message }}</div> @enderror
|
|
</div>
|
|
<div class="mb-3 form-check">
|
|
<input type="checkbox" class="form-check-input" id="is_public" name="is_public" value="1" {{ old('is_public', true) ? 'checked' : '' }}>
|
|
<label class="form-check-label" for="is_public">Público</label>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary"><i class="bi bi-save"></i> Salvar</button>
|
|
<a href="{{ route('prompt-templates.index') }}" class="btn btn-secondary">Cancelar</a>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endsection
|