PHP code example of stellarsecurity / stellar-laravel-devices

1. Go to this page and download the library: Download stellarsecurity/stellar-laravel-devices library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stellarsecurity / stellar-laravel-devices example snippets


return [
  // ...
  'names' => ['Allison', 'Arthur', 'Ana'],
  'names_path' => storage_path('app/device-names.json'),
];

use StellarDevice;

// Add device
$response = StellarDevice::add('customer-123', 'Office MacBook', true);

// Or: generate a human-friendly random name
$name = StellarDevice::randomName();
$response = StellarDevice::add('customer-123', $name, true);

// Or: let the package pick a random name for you
$response = StellarDevice::addRandom('customer-123', true);

// List devices
$response = StellarDevice::devices('customer-123');

// Delete device
$response = StellarDevice::delete('customer-123', 'Office MacBook');
bash
php artisan vendor:publish --provider="StellarSecurity\DeviceApi\StellarDeviceServiceProvider" --tag=config