定制 millerphp/laravel-browserless 二次开发

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

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

millerphp/laravel-browserless

最新稳定版本:v1.0.0

Composer 安装命令:

composer require millerphp/laravel-browserless

包简介

This is my package laravel-browserless

README 文档

README

A powerful Laravel package for interacting with the Browserless API, providing an elegant way to take screenshots, generate PDFs, analyze performance, and automate browser tasks.

Installation

  1. Install the package via Composer:
composer require millerphp/laravel-browserless
  1. Publish the configuration file:
php artisan vendor:publish --provider="MillerPHP\LaravelBrowserless\BrowserlessServiceProvider"
  1. Configure your environment variables in .env:
BROWSERLESS_API_KEY=your_api_key
BROWSERLESS_API_URL=https://chrome.browserless.io

Quick Start

Take a screenshot:

use MillerPHP\LaravelBrowserless\Facades\Browserless;

$screenshot = Browserless::screenshot()
    ->url('https://example.com')
    ->send();

Generate a PDF:

$pdf = Browserless::pdf()
    ->url('https://example.com')
    ->send();

Analyze performance:

$performance = Browserless::performance()
    ->url('https://example.com')
    ->send();

$score = $performance->categoryScore('performance');

Documentation

Features

  • Screenshots: Capture full-page or element-specific screenshots
  • PDF Generation: Convert web pages to PDFs with custom options
  • Performance Analysis: Analyze website performance using Lighthouse
  • Browser Automation: Execute complex browser tasks using BQL
  • Custom Options: Fine-tune every aspect of your requests
  • Error Handling: Comprehensive error handling and logging
  • Testing Support: Built-in testing utilities and mocking
  • Security: Secure configuration and API key management
  • Performance: Caching, batch processing, and resource optimization

Requirements

  • PHP 8.1 or higher
  • Laravel 9.0 or higher
  • Composer

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 1.84k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知