I am getting this array from the view
When i do return $BlogData['Tag'];
The result is
["1", "2"]
How can i insert this into each record i.e., a fresh entry in the table ?
S.No | Tag
3 | 1
4 | 2
Like the above given in the table
When i try
foreach ($BlogData['Tag'] as $x)
{
echo $x;
Tag::create($x);
}
I am getting this error
message: "Argument 1 passed to Illuminate\Database\Eloquent\Model::create() must be of the type array, string given,