Beginner in API
I have table post_tag
which is posts
table has relation ( many to many ) with tags
table.
my controller code ( every thing is good ):
$post = Post::create($data);
$post->tag()->attach($request->tags);
return $this->apiRespone($post , 'Added Post Successfuly', null ,200);
My question is here: now I send array of tags like that! Is that the best way or the correct way to send array ( means when I give this api url
to mobile developer, he will know what to do with this api url
?
My way is correct or not ?