um-flint / laravel-device42 by dowilcox

Laravel package for the Device42 API.
479
3
8
Package Data
Maintainer Username: dowilcox
Maintainer Contact: dowilcox@umflint.edu (Donald Wilcox)
Package Create Date: 2016-08-17
Package Last Update: 2019-08-02
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-12-23 03:29:16
Package Statistics
Total Downloads: 479
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 3
Total Watchers: 8
Total Forks: 0
Total Open Issues: 0

Laravel Device42

Laravel 5 package to interact with the Device42 API. Not all of the Device42 API endpoints are completed. If you need an endpoint added feel free to submit a pull request.

Installation

Install with composer

composer require um-flint/laravel-device42

Register the package

In config/app.php add the service provider.

UMFlint/Device42/Device42ServiceProvider::class,

Example usage

Basic example in a controller:

use UMFlint/Device42/Entities/Devices;
...

public function getIndex(Devices $devicesEntity)
{
    $devices = $devicesEntity->all();
}

$devices will return an array like:

[
            'Devices' =>
                [
                    [
                        'asset_no'   => null,
                        'device_id'  => 34,
                        'device_url' => '/api/1.0/devices/id/34/',
                        'name'       => '320',
                        'groups'     => 'Prod_East:no, Corp:yes',
                        'serial_no'  => null,
                        'uuid'       => '07FCE572-B2B3-B44C-BB1C-6799B509CC31',
                    ],
                    [
                        'asset_no'   => null,
                        'device_id'  => 36,
                        'device_url' => '/api/1.0/devices/id/36/',
                        'name'       => '323p1',
                        'groups'     => 'Prod_East:no, Corp:yes',
                        'serial_no'  => null,
                        'uuid'       => '22D4DEBD-6EAA-D441-89AE-047A9A60E9FB',
                    ],
                    [
                        'asset_no'   => null,
                        'device_id'  => 39,
                        'device_url' => '/api/1.0/devices/id/39/',
                        'name'       => 'd250',
                        'groups'     => 'Prod_East:no, Corp:yes',
                        'serial_no'  => null,
                        'uuid'       => '76CE2AFC-58E3-1B4E-AB7A-6FECB480154B',
                    ],
                    [
                        'asset_no'   => null,
                        'device_id'  => 33,
                        'device_url' => '/api/1.0/devices/id/33/',
                        'name'       => 'd313p1',
                        'groups'     => 'Prod_East:no, Corp:yes',
                        'serial_no'  => null,
                        'uuid'       => 'BC1E0971-9889-8946-A92B-8F1D830C1AF2',
                    ],
                ],
        ]