PHP code example of ifaniqbal / api-its-laravel

1. Go to this page and download the library: Download ifaniqbal/api-its-laravel 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/ */

    

ifaniqbal / api-its-laravel example snippets


'providers' => [
    'Ifaniqbal\ApiIts\ApiItsServiceProvider',
];

'aliases' => [
    'ApiIts' => 'Ifaniqbal\ApiIts\Facades\ApiIts',
];

API_ITS_TOKEN_URL= # access token (client_credentials) token URL, default: https://my.its.ac.id/token
API_ITS_CLIENT_ID= # client ID
API_ITS_CLIENT_SECRET= # client secret


namespace App\Http\Controllers;

use App\Mahasiswa;
use Ifaniqbal\ApiIts\Facades\ApiIts;

class MahasiswaController extends Controller
{
    public function show($id)
    {
        $mahasiswa = Mahasiswa::find($id);
        $frsKuliah = ApiIts::username($mahasiswa->username)
            ->mahasiswaFrsKuliah();
    }
}