septio/laravel-nova-meaning-cloud 问题修复 & 功能扩展

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

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

septio/laravel-nova-meaning-cloud

Composer 安装命令:

composer require septio/laravel-nova-meaning-cloud

包简介

A field for Laravel Nova that generates summarized text from another text field by using Meaning Cloud's API.

README 文档

README

A field for Laravel Nova that generates summarized text from another text field by using Meaning Cloud's API

This packages requires an account on Meaninccloud.com (don't worry, it's free)

Installation

You can install the package in to a Laravel app that uses Nova via composer:

$ composer require septIO/LaravelNovaMeaningCloud

In your .env file add the following line:

MEANINGCLOUD_KEY=[Your Meaning Cloud API key]

Usage

Import the field into your Nova resource:

use Septio\LaravelMeaningcloud\LaravelMeaningcloud;

Add the field to your fields[] array:

public function fields(Request $request)
    {
        return [
            //... Rest of fields
            LaravelMeaningcloud::make("resume")->from("Body")->sentences(5)->hideFromIndex(),
        ];
    }

The Field needs 2 inputs: make("table column"), as usual, the make refers to the column on the table which this field writes/reads from.

from("Other Field Name") is the field which the text summarization should ready from.

sentences(x) is optional. If set to a number, then the text from from() will be summarized in x amount of sentences. Default is 3

Examples

Let's setup a simple blog

public function fields(Request $request){
    return [
        Text::make("title"),
        Trix::make("body"), // We'll use the builtin Trix editor for the body
        LaravelMeaningCloud::make("resume")->from("Body"),
        BelongsTo::make("author")
    ];
}

The from needs to match the placeholder if the referenced field, not the name. The reason for this is shown in the next example.

Let's change the display name of the body field:

public function fields(Request $request){
    return [
        Text::make("title"),
        Trix::make("Text to display", "body"), // Now "Body" doesn't work anymore
        LaravelMeaningCloud::make("resume")->from("Text to display"), // We'll have to use "Text to display"
        BelongsTo::make("author")
    ];
}

Notice

This tool is reliable on AI from Meaninccloud.com, so results may wary.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: Vue

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-01-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固