2017 © Pedro PelĂĄez
 

library recastai_sdk_laravel

A laravel package for RecastAI based on the official PHP SDK Recast.AI recastai/sdk_php from Marian André <marian.andre@recast.ai>

image

kanian/recastai_sdk_laravel

A laravel package for RecastAI based on the official PHP SDK Recast.AI recastai/sdk_php from Marian André <marian.andre@recast.ai>

  • Monday, October 9, 2017
  • by kanian
  • Repository
  • 1 Watchers
  • 0 Stars
  • 502 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 15 % Grown

The README.md

recastai_sdk_laravel: Laravel Package for RecastAI PHP SDK support

Based on the official PHP SDK Recast.AI recastai/sdk_php it provides a convenient service provider for the SDK., (*1)

Quick Start Guide

  • Create a Laravel 5.5 project: composer create-project laravel/laravel myproject dev-develop
  • cd myproject
  • Add dependency: composer require kanian/recastai_sdk_laravel=dev-master
  • Copy configuration: php artisan vendor:publish

Now you are ready to use the \RecastAI Facace, e.g. open routes/web.php:, (*2)

``` PHP <?php, (*3)

Route::get('tryrecastai', function(Request $request) { return \RecastAI::get() ->request ->analyseText('hello'); });, (*4)


Or in a controller: ``` PHP <?php namespace App\Http\Controllers; class TryRecastAIController extends Controller { /** * Just Testing RecastAI * * @return Response */ public function __invoke() { $client = \RecastAI::get(); $res = $client->request->analyseText('hello'); if ($res->intent()->slug == 'greetings') { // Do your code } return view('testrecastai', ['text' => $res->source, 'answer'=>"Yello!"]); } }

To override the default configuration add the following parameters to your .env file., (*5)

RECASTAI_TOKEN = YOUR_RECASTAI_REQUEST_TOKEN
LANGUAGE = 'en'

The Versions

09/10 2017

dev-master

9999999-dev

A laravel package for RecastAI based on the official PHP SDK Recast.AI recastai/sdk_php from Marian André <marian.andre@recast.ai>

  Sources   Download

MIT

The Requires

 

by Patrick Assoa Adou