tag add more customized options + NexusDB::rememter()

This commit is contained in:
xiaomlove
2022-03-28 15:58:12 +08:00
parent d15a837188
commit b613a46b8d
13 changed files with 164 additions and 33 deletions
+1 -4
View File
@@ -46,10 +46,7 @@ class TagController extends Controller
public function store(Request $request)
{
$request->validate($this->getRules());
$data = $request->all();
if (isset($data['priority'])) {
$data['priority'] = intval($data['priority']);
}
$data = array_filter($request->all());
$result = $this->repository->store($data);
$resource = new TagResource($result);
return $this->success($resource);
+5
View File
@@ -18,6 +18,11 @@ class TagResource extends JsonResource
'id' => $this->id,
'name' => $this->name,
'color' => $this->color,
'font_color' => $this->font_color,
'font_size' => $this->font_size,
'padding' => $this->padding,
'margin' => $this->margin,
'border_radius' => $this->border_radius,
'priority' => $this->priority,
'created_at' => format_datetime($this->created_at),
'updated_at' => format_datetime($this->updated_at),