cartalyst / tags

A Tagging package that easily allows you to add tags to your Eloquent models.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

still untag() didsnt work

hizone opened this issue · comments

hi
i chack but its didnt fix

i have 2 tags in my business and i try to remove them but its still show to me
this is my code:
$business->untag();
dd($business->tags()->get());

and this is my result
image

i can only to put tags but didnt delete them

laravrl 5.6.15

tahnks

Hello @Haizone

I just tested, again, and it's working as expected.

Here's the code i used to test + the package unit tests

$user = App\User::firstOrCreate(['email' => 'first@user.com', 'name' => 'First User', 'password' => '123']);

$user->tag(['foo', 'bar', 'baz']);

dump($user->tags()->get()->pluck('slug', 'name')->toArray());

$user->untag('foo');

dump($user->tags()->get()->pluck('slug', 'name')->toArray());

$user->untag();

dump($user->tags()->get()->pluck('slug', 'name')->toArray());

Here is the dump

array:3 [▼
  "foo" => "foo"
  "bar" => "bar"
  "baz" => "baz"
]
array:2 [▼
  "bar" => "bar"
  "baz" => "baz"
]
[]

Laravel: 5.6.15
Cartalyst Tags: 6.0.1

Ensure that you're using the latest version of the Cartalyst Tags as well.