laravel-gmail
laravel-gmail copied to clipboard
LaravelGmail::message()->all() returns empty
Hi. I'm developing an application, where I need to check gmail inbox for responses for certain messages. I'm trying to get messages by calling
$messages = LaravelGmail::message()->after($startTime)->all();
Then I'm using foreach to check all emails, like it's written in doc section. But I'm getting an empty result. I'm using php 7.4 with Laravel 7.3, library version is 4.0.4 Also I'm trying to do this via console commands, if this matters. I'll appreciate any help.
I had similar problem. The issue was that the date format was wrong. So I had also the time in there.
So what I did was this:
$monthago = Carbon::now()->subMonth(); $monthago = $monthago->toDateString();
This fixed it.