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
This commit is contained in:
54
app/Filament/Resources/Templates/Schemas/TemplateForm.php
Normal file
54
app/Filament/Resources/Templates/Schemas/TemplateForm.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user