Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mehrancodes's avatar

Got a PHP error while using Tinker

I have a products and tags Table with a pivot for them.
And actually in Tinker i created a record for both of them and attached one record to the pivot table like this

$product->tags->attach(1);

After that, when i executed this command:

$product->tags->toArray();

that gave me the correct result, But with this error message:

PHP error: PDO::prepare(): send of 326 bytes failed with errno=32 Broken pipe in /home/vagrant/code/shopper/vendor/laravel/framework/src/Illuminate/Database/Connection.php on line 319

I just wanted to report this error.

0 likes
2 replies
mehrancodes's avatar

Hi @Petronetto! Actually no! I didn't received any answer and the project was just an exercise not for production.

Please or to participate in this conversation.