So I have a site for movie and tv-show reviews. It also gets most popular and latest movies/tv shows from IMDB or themoviedb. It is all okay with IMDB, but when I select tmdb as main movie data provider and click on a movie after that, I get an error "Call to a member function addDays() on null" Here is the code:
if ($title->review->isEmpty() && $date < Carbon::now()->toDateString() && $title->updated_at->addDays(1) <= Carbon::now())
This means
updated_at
is empty. You should make sureupdated_at
is not empty in all rows. You can set this column as not nullable:Or check it for
null
: