first(); if ($googleReview) { return $googleReview->id; } // Create if does not exists yet $googleReview = GoogleReview::create([ 'restaurant_id' => $tenantId, 'meta_value' => [ 'config' => [ 'enabled' => false, 'place_id' => '', 'stars' => 4 ] ] ]); return $googleReview->id; } public static function getItems(AppSettingsRequest $request, $tenantId) { $googleReviewId = GoogleReview::getId($tenantId); $googleReview = GoogleReview::find($googleReviewId); return $googleReview->config; } }