filepreviews/filepreviews-laravel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

filepreviews/filepreviews-laravel

Composer 安装命令:

composer require filepreviews/filepreviews-laravel

包简介

Laravel 5 service provider for FilePreviews.io

README 文档

README

Laravel 5 service provider for FilePreviews.io

Installation

$ composer require filepreviews/filepreviews-laravel

To use the FilePreviews Service Provider, you must register the provider when bootstrapping your Laravel application.

Find the providers key in your config/app.php and register the FilePreviews Service Provider.

    'providers' => [
        // ...
        
        FilePreviews\Laravel\FilePreviewsServiceProvider::class,
    ]

Find the aliases key in your config/app.php and add the FilePreviews facade alias.

    'aliases' => [
        // ...
        
        'FilePreviews' => FilePreviews\Laravel\FilePreviewsFacade::class,
    ]

To customize the configuration file, publish the package configuration using Artisan.

$ php artisan vendor:publish

Update your settings in the generated config/filepreviews.php configuration file.

<?php

return [
    'api_key' => env('FILEPREVIEWS_API_KEY', ''),
    'api_secret' => env('FILEPREVIEWS_API_SECRET', '')
];

Usage

In order to use the FilePreviews PHP client library within your app, you need to resolve it from the Laravel Service Container.

$fp = app('FilePreviews');
$fp->generate($url, $options);

Handling Webhooks

Point a route to the controller.

Route::post('filepreviews/webhook', '\FilePreviews\Laravel\WebhookController@handleWebhook');

Since FilePreviews webhooks need to bypass Laravel's CSRF verification, be sure to list the URI as an exception in your VerifyCsrfToken middleware:

protected $except = [
    'filepreviews/webhook',
];

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-11-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固