Поддержка тегов шаблонами
This commit is contained in:
@@ -24,6 +24,7 @@ class DocImportController extends Controller
|
||||
'description' => $template->description,
|
||||
'file_url' => $urlFile,
|
||||
'variables' => $template->variables,
|
||||
'tags' => $template->tags
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -35,6 +36,7 @@ class DocImportController extends Controller
|
||||
'name' => 'nullable|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
'variables' => 'nullable|array',
|
||||
'tags' => 'nullable|array',
|
||||
]);
|
||||
|
||||
$template = DocumentTemplate::findOrFail($data['id']);
|
||||
@@ -53,6 +55,7 @@ class DocImportController extends Controller
|
||||
'name' => $data['name'],
|
||||
'description' => $data['description'],
|
||||
'variables' => $data['variables'],
|
||||
'tags' => $data['tags'] ?? [],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -63,6 +66,7 @@ class DocImportController extends Controller
|
||||
'name' => 'nullable|string|max:255',
|
||||
'description' => 'nullable|string',
|
||||
'variables' => 'nullable|array',
|
||||
'tags' => 'nullable|array',
|
||||
]);
|
||||
|
||||
$file = $request->file('file');
|
||||
@@ -77,6 +81,7 @@ class DocImportController extends Controller
|
||||
'content' => 'content',
|
||||
'variables' => $data['variables'] ?? [],
|
||||
'source_path' => "storage/$laravelPath" . '/' . $templateFileName,
|
||||
'tags' => $data['tags'] ?? [],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,11 +13,13 @@ class DocumentTemplate extends Model
|
||||
'description',
|
||||
'content',
|
||||
'variables',
|
||||
'source_path'
|
||||
'source_path',
|
||||
'tags'
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'variables' => 'array'
|
||||
'variables' => 'array',
|
||||
'tags' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user