定制 convertain/laravel-babylovegrowth 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

convertain/laravel-babylovegrowth

Composer 安装命令:

composer require convertain/laravel-babylovegrowth

包简介

Laravel package for integrating with BabyLoveGrowth.ai API to fetch and store AI-curated parenting articles and baby development content

README 文档

README

Latest Version on Packagist Total Downloads CI PHPStan Level 10 PHP 8.3+ Laravel 12

A Laravel package for integrating with the BabyLoveGrowth.ai* API to fetch and manage SEO-optimized articles for organic traffic growth in your Laravel application.

Affiliate Disclosure: This package integrates with BabyLoveGrowth.ai*, and we may receive compensation if you sign up for their services through our affiliate links (marked with *). This does not affect the functionality of the package or increase your costs. We only recommend services we believe provide value to developers and businesses.

Features

  • 🚀 Simple API Integration - Fetch SEO-optimized articles from BabyLoveGrowth.ai* with a single command
  • 🔍 Domain Filtering - Optional filtering by specific domains/websites
  • 🌍 Language Support - Filter and categorize articles by language (20+ languages supported)
  • 📦 Local Storage - Store articles in your database for offline access and fast queries
  • Automatic Sync - Background sync capabilities with configurable intervals
  • 🛡️ Type Safe - Full PHPStan level 10 compliance for robust code
  • 🎯 Laravel Native - Built with Laravel best practices and conventions

Installation

Install the package via Composer:

composer require convertain/laravel-babylovegrowth

The package will automatically register its service provider and make the configuration and migrations available.

Run Migrations

Run the database migrations:

php artisan migrate

Optional: Publish Configuration

If you need to customize the configuration, you can optionally publish the config file:

php artisan vendor:publish --tag=babylovegrowth-config

Optional: Publish Migrations

If you need to customize the database schema, you can optionally publish the migrations:

php artisan vendor:publish --tag=babylovegrowth-migrations
php artisan migrate

Configuration

Add your BabyLoveGrowth.ai* API credentials to your .env file:

BABYLOVEGROWTH_ENABLED=true
BABYLOVEGROWTH_API_KEY=your-api-key-here
BABYLOVEGROWTH_DOMAIN_FILTER=example.com  # Optional: filter by specific domain

💡 Need an API key? If you find this package useful and don't have a BabyLoveGrowth.ai* account yet, please consider signing up through our affiliate link* to support the development of this package.

That's it! The package works immediately with just the environment variables. No need to publish configuration files unless you want to customize the defaults.

Advanced Configuration

If you published the configuration file (config/babylovegrowth.php), you can customize:

  • enabled - Enable/disable the integration
  • api_key - Your BabyLoveGrowth.ai* API key
  • domain_filter - Optional domain filter for articles
  • cache_ttl - Cache time-to-live for API responses (in seconds)

Usage

Database Setup

Run the migrations to create the required database tables:

php artisan migrate

Seeders

The package includes a factory-based seeder that uses FakerPHP to generate realistic, randomly-varied BabyLoveGrowth SEO articles:

php artisan db:seed --class="Database\Seeders\BabyLoveGrowthArticleSeeder"

This will create 15 unique articles with dynamically generated content featuring:

  • Smart Title Generation: Pattern-based templates with contextual variables
  • Dynamic Content: Realistic paragraphs using Faker's text generation
  • Varied Sections: 3-6 sections per article with contextual topics
  • Natural Language: Template-based sentences with SEO/content marketing focus
  • Realistic Metadata: Proper meta descriptions, image URLs, and timestamps
  • Multi-language Support: Articles in English, Spanish, French, German, Italian, and Portuguese

Each article follows the exact BabyLoveGrowth.ai* API structure while providing completely unique, realistic content every time the seeder runs.

Fetching Articles

Use the Artisan command to fetch articles from the BabyLoveGrowth.ai* API:

# Fetch all articles
php artisan babylovegrowth:fetch

# Fetch articles with filters
php artisan babylovegrowth:fetch --language=en
php artisan babylovegrowth:fetch --domain=example.com
php artisan babylovegrowth:fetch --force  # Force update existing articles

Using the Model

Query articles using the Eloquent model:

use Convertain\BabyLoveGrowth\Models\BabyLoveGrowthArticle;

// Get all articles
$articles = BabyLoveGrowthArticle::all();

// Get articles by language
$englishArticles = BabyLoveGrowthArticle::byLanguage('en')->get();

// Get published articles (ordered by date)
$recentArticles = BabyLoveGrowthArticle::published()->take(10)->get();

// Get articles with content
$articlesWithContent = BabyLoveGrowthArticle::withContent()->get();

// Find by external ID
$article = BabyLoveGrowthArticle::findByExternalId(123);

// Find by slug
$article = BabyLoveGrowthArticle::findBySlug('parenting-tips');

Article Properties

Each BabyLoveGrowthArticle model includes:

$article->id;                    // Local database ID
$article->external_id;           // [BabyLoveGrowth.ai](https://af.boaa.it/babylovegrowth)* article ID
$article->title;                 // Article title
$article->slug;                  // URL-friendly slug
$article->language_code;         // Language code (e.g., 'en', 'es')
$article->org_website;           // Organization website
$article->content_markdown;      // Markdown content
$article->content_html;          // HTML content
$article->meta_description;      // SEO meta description
$article->hero_image_url;        // Featured image URL
$article->external_created_at;   // Original creation date
$article->created_at;            // Local creation date
$article->updated_at;            // Local update date

Helper Methods

The model includes several helpful methods:

// Check if article has content
if ($article->hasContent()) {
    // Article has either markdown or HTML content
}

// Get excerpt (auto-generated from meta description or content)
$excerpt = $article->getExcerpt(200); // Limit to 200 characters

// Get estimated reading time
$readingTime = $article->reading_time; // Returns minutes

Programmatic API Usage

Use the API service directly in your code:

use Convertain\BabyLoveGrowth\Services\BabyLoveGrowthApiService;
use Convertain\BabyLoveGrowth\Services\DomainFilterService;

// Fetch articles from API
$apiService = app(BabyLoveGrowthApiService::class);
$articles = $apiService->getAllArticles();

// Apply domain filtering
$domainFilter = app(DomainFilterService::class);
$shouldInclude = $domainFilter->shouldSyncArticle('https://example.com/article');

Background Sync

Use the sync service for automated synchronization:

use Convertain\BabyLoveGrowth\Services\BabyLoveGrowthSyncService;

$syncService = app(BabyLoveGrowthSyncService::class);

// Check if sync should run
if ($syncService->shouldSync()) {
    $result = $syncService->sync();
}

// Get sync statistics
$stats = $syncService->getSyncStats();

Database Schema

The package creates a blog_babylovegrowth_articles table with the following structure:

Column Type Description
id bigint Primary key
external_id integer BabyLoveGrowth.ai* article ID
title string Article title
slug string URL slug
language_code string Language code
org_website string Organization website
content_markdown text Markdown content
content_html text HTML content
meta_description text SEO description
hero_image_url string Featured image URL
external_created_at timestamp Original creation date
created_at timestamp Local creation date
updated_at timestamp Local update date

Error Handling

The package includes comprehensive error handling:

use Convertain\BabyLoveGrowth\Exceptions\BabyLoveGrowthApiException;

try {
    $articles = $apiService->getAllArticles();
} catch (BabyLoveGrowthApiException $e) {
    // Handle API errors
    logger()->error('BabyLoveGrowth API Error: ' . $e->getMessage());
}

Testing

Run the package tests:

composer test

Run tests with coverage:

composer test-coverage

Run static analysis:

composer analyse

Run code style checks:

composer pint -- --test

Fix code style issues:

composer pint

Continuous Integration

This package includes comprehensive GitHub Actions workflows:

  • Tests: Runs PHPUnit tests across PHP 8.3 and 8.4 with Laravel 12.x
  • Static Analysis: PHPStan Level 10 analysis for type safety
  • Code Style: Laravel Pint PSR-12 compliance checking
  • Security: Automated vulnerability scanning with composer audit

All workflows run on push/pull requests to ensure code quality.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@convertain.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About BabyLoveGrowth.ai

BabyLoveGrowth.ai* is an AI-powered SEO and content marketing automation platform that helps businesses grow organic traffic through automated content generation and backlink building. The platform provides:

  • Daily SEO/LLM-optimized articles with real-time research and expert citations
  • Automated backlink exchange network to boost domain authority
  • Multi-language content generation (20+ languages supported)
  • Direct publishing integration with WordPress, Webflow, Shopify, and other platforms
  • JSON-LD schema markup for enhanced search visibility
  • ChatGPT and Google optimization for maximum organic reach

This package enables Laravel applications to integrate with their content API for seamless access to high-quality SEO-optimized articles.

For more information about BabyLoveGrowth.ai, visit their website.

*Affiliate links - we may receive compensation if you sign up through these links.

convertain/laravel-babylovegrowth 适用场景与选型建议

convertain/laravel-babylovegrowth 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 08 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「package」 「api」 「blog」 「cms」 「content」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 convertain/laravel-babylovegrowth 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 convertain/laravel-babylovegrowth 我们能提供哪些服务?
定制开发 / 二次开发

基于 convertain/laravel-babylovegrowth 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 35
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-05