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

AdiInviter's avatar

Calling save() method doesn't output anything in Tinker.

Hello,

When i build up an object and call save() method in tinker, it doesn't output anything nor does it save any data into database table. I tried in both Git Bash and Laragon's terminal but same thing is happening in both the terminals.

I'm on Windows 7 32-bit running Laravel Framework 5.5.28 in Laragon - nginx.

Tinker save method call

Does anyone know how to fix this?

0 likes
4 replies
burlresearch's avatar

\Illuminate\Database\Eloquent\Model::save returns a bool - so it's either a true/false. Not sure what your terminal's display works like, but it's very possible that those boolean return values are just not getting displayed for you.

If you really need see something then you could try:

$res = (int) $article->save();
echo $res;

perhaps that will show you whether the value was saved. If it actually was not saved, you should check your logs, normally in: storage/logs/laravel.log

and see what's at the end - this may give you a better indication of what's going wrong.

AdiInviter's avatar

@burlresearch , Thank you for replying.

I checked the logs at storage/logs/laravel.log file and it is empty.

The terminals I have tried so far are :

Window's Command Prompt - Run As Administrator
Cmder
Git Bash/Mintty
Babun

Update:

I'm getting Segmentation fault error when I run below command and wait for 20+ minutes :

$article=App\Article::create(['title'=>'New Article','body'=>'New Body','published_at'=>Carbon\Carbon::now()]);

Tinker Segmentation fault

AdiInviter's avatar
AdiInviter
OP
Best Answer
Level 3

I just found out I have 2 installations of PHP on my system. One that came with XAMPP and other one that came with Laragon. After checking my path environment variables, I found that it was using PHP that came with XAMPP. So after updating my path variable to use Laragon's php binary, everything is working fine now.

Thanks a lot @shez1983 and @burlresearch for replying.

Eveything is working fine now

Please or to participate in this conversation.