Files
hoshpoint-backend/app/Filament/Resources/Templates/Schemas/TemplateForm.php
soheil khaledabadi ae974c2afa feat: add ApiResponse trait for standardized API responses
chore: update composer dependencies to include phppresentation

chore: update composer.lock after adding phppresentation

feat: create categories migration for category management

feat: create templates migration for template storage

feat: create template generations migration for tracking template usage

feat: create template keys migration for template customization

feat: create notifications migration for user notifications

feat: update API routes for categories, templates, and user profile management

docs: update API documentation to include new endpoints for profile and wallet
2026-07-07 01:03:12 +03:30

55 lines
1.9 KiB
PHP

<?php
namespace App\Filament\Resources\Templates\Schemas;
use App\Models\Category;
use Filament\Forms\Components\FileUpload;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Schema;
class TemplateForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
Select::make('category_id')
->label('دسته‌بندی')
->options(fn (): array => Category::query()->pluck('name', 'id')->all())
->searchable()
->required(),
TextInput::make('title')
->label('عنوان')
->required()
->maxLength(255),
TextInput::make('slug')
->label('شناسه')
->required()
->unique(ignoreRecord: true)
->maxLength(255),
Textarea::make('description')
->label('توضیحات')
->maxLength(1000)
->rows(3),
FileUpload::make('file_path')
->label('فایل پاورپوینت')
->disk('local')
->directory('templates/sources')
->acceptedFileTypes(['application/vnd.openxmlformats-officedocument.presentationml.presentation'])
->required()
->visibility('private'),
FileUpload::make('thumbnail_path')
->label('تصویر بندانگشتی')
->disk('public')
->directory('templates/thumbnails')
->image(),
Toggle::make('is_active')
->label('فعال')
->default(true),
]);
}
}