2017 © Pedro Peláez
 

library service-now-model

PHP7 Laravel5 component to connect to ServiceNow Table API

image

ohtarr/service-now-model

PHP7 Laravel5 component to connect to ServiceNow Table API

  • Tuesday, March 20, 2018
  • by ohtarr
  • Repository
  • 1 Watchers
  • 0 Stars
  • 255 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 45 % Grown

The README.md

ServiceNowModel

A laravel Model to access service now table api, (*1)

You are nutz if you use this...ABSolutELY MENtal!:+1:, (*2)

Requires Laravel 5.x and GuzzleHttp, (*3)

How to use :, (*4)

Set the following variables in your laravel .env file:, (*5)

'SNOWBASEURL' = https://yourcompany.service-now.com/api/now/v1/table
'SNOWUSERNAME' =
'SNOWPASSWORD' =

Create a new model in your Laravel App folder PER table and set $table. Example:, (*6)

****************ServiceNowIncident.php**********************, (*7)

<?php

namespace App;

use ohtarr\ServiceNowModel;
use GuzzleHttp\Client as GuzzleHttpClient;

class ServiceNowIncident extends ServiceNowModel
{
    protected $guarded = [];

    public $table = "incident";

    public function __construct(array $attributes = [])
    {
        $this->snowbaseurl = env('SNOWBASEURL'); //https://mycompany.service-now.com/api/now/v1/table
        $this->snowusername = env("SNOWUSERNAME");
        $this->snowpassword = env("SNOWPASSWORD");
        parent::__construct($attributes);
    }

}

and in your application you can utilize it :, (*8)

$incident = new App\ServiceNowIncident;
$incident->where("number","=","INC2321232")->get();

or, (*9)

$incident = App\ServiceNowIncident::where("number","=","INC2321232")->first()

or, (*10)

$incident = App\ServiceNowIncdient::find("1782fd1d6fcb87005d6dcd364b3ee4c1");

or if you are brave:, (*11)

$incidents = App\ServiceNowIncident::all();

The Versions

20/03 2018

dev-master

9999999-dev http://github.com/ohtarr/service-now-model

PHP7 Laravel5 component to connect to ServiceNow Table API

  Sources   Download

LGPL3.0

The Requires

 

by Avatar ohtarr

php7 laravel5