rinvex/laravel-tags

Unable to create Tags

Closed this issue · 1 comments

Issue reported by @noxify here https://github.com/rinvex/obsolete-tag/issues/18

Hi,

not sure if it's just a problem on my side or if it's a bug...

I have a seeder with the following part:

$lesson = App\Models\Lesson::create([
	'user_id'   => 1,
	'title'     => $faker->text(70),
	'teaser'    => $faker->text( 200 ),
	'content'   => '<p>'.$faker->realText(100, true).'</p>',
	'status'    => $faker->randomElement(['draft', 'published']),
	'type'      => $lesson_type
]);

$lesson->tag( $faker->words(5) );

The lessons record was created successfully, but for the tags, I get the following error messages:

[Illuminate\Database\QueryException]                                                                                                                                       
  SQLSTATE[42883]: Undefined function: 7 ERROR:  operator does not exist: text ->> unknown                                                                                   
  LINE 1: select * from "tags" where "name"->>'en' = $1 limit 1                                                                                                              
                                           ^                                                                                                                                 
  HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts. (SQL: select * from "tags" where "name"->>'en' = tag1 limit 1)  

I'm using the latest develop branch with postgres 9.6.10.

Further Reply

I changed my composer.json to "rinvex/tag" : "2.*" and everything is working :)

I will use the 2.* branch now :)

Closed since this is probably no longer relevant with the recent releases of this package, and PostgreSQL as well.