laravel-gmail icon indicating copy to clipboard operation
laravel-gmail copied to clipboard

LaravelGmail::message()->all() returns empty

Open girin opened this issue 4 years ago • 1 comments

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.

girin avatar Jan 20 '21 15:01 girin

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.

joneriktalvio avatar Feb 12 '23 13:02 joneriktalvio