承接 voyanara/avito-laravel-client 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

voyanara/avito-laravel-client

最新稳定版本:1.0.10

Composer 安装命令:

composer require voyanara/avito-laravel-client

包简介

A Laravel package for integrating with the Avito API, allowing seamless interaction with Avito features and data from your Laravel application.

README 文档

README

Avito Laravel API PHP Client

This package is a client for the Avito API designed to simplify integration with the Avito platform from your Laravel applications. It provides a set of tools to work with the Avito API, allowing you to automate and streamline tasks related to managing listings, updating information, and obtaining statistics.

Why Use the API

The Avito API significantly simplifies working on the platform by allowing you to:

  • Automate operations and actions you perform on Avito.
  • Integrate Avito with your CRM system, ERP system for content management, messaging system for customer communication, or analytics system.
  • Run your business more efficiently by enabling automatic data updates and obtaining statistics.

Features of the Avito API

With this client, you can:

  • Communicate with Customers: Use ready-made integrations or create your own with the systems you need.
  • Receive Autoload Information: Get data on autoload success and errors.
  • Update Prices and Availability: Quickly update price and availability information on Avito from your system.
  • Obtain Statistics: Analyze the effectiveness of your listings and get detailed statistics.

Specific methods for each category (e.g., Avito Real Estate or Avito Jobs) are available in the Avito API documentation.

Requirements

  • PHP: ^8.3
  • Laravel Framework: ^11.0
  • Spatie Laravel Data: ^4.9

Ensure that your environment meets these requirements before proceeding with the installation.

Installation

Laravel Avito API Client can be installed via Composer:

composer require voyanara/avito-laravel-client

The package will automatically register a service provider.

This package comes with a migration and a configuration file. You can publish them using the following Artisan command:

php artisan vendor:publish --provider="Voyanara\LaravelApiClient\Infrastructure\Providers\AvitoModuleServiceProvider --tag="config"
php artisan vendor:publish --provider="Voyanara\LaravelApiClient\Infrastructure\Providers\AvitoModuleServiceProvider --tag="migrations"

This is the default content of the config file that will be published as config/avito.php

Usage

You have several options for using the Avito API client in your Laravel application:

Using the Facade

To use the Avito API client via a facade, you can call methods directly on the AvitoClient facade.

Example:

public function action(AvitoClient $client)
{
    $client::messenger()->getChats();
    //or
    AvitoClient::user()->self();
}

If Laravel does not recognize the facade and you have defined it in composer.json under extra > laravel > aliases, make sure to import it in your file:

use Voyanara\LaravelApiClient\Application\Facades\AvitoClientFacade as AvitoClient;

Using dependency injection

Alternatively, you can use dependency injection to access the Avito API client. This approach is recommended if you prefer to inject dependencies into your methods or constructors.

use Voyanara\LaravelApiClient\Application\Facades\Client;

public function action(Client $client)
{
    $client->messenger()->getChats();
    //or
    $client->user()->getBalance();
    $client->user()->getOperationsHistory();
}

统计信息

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

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-17