You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.5 KiB
83 lines
2.5 KiB
<?php
|
|
|
|
namespace Database\Seeders\Channel;
|
|
|
|
use App\Domains\Channel\Enums\Api\ApiType;
|
|
use App\Domains\Channel\Enums\Client\AuthType;
|
|
use App\Domains\Channel\Models\ApiEndpoint;
|
|
use App\Domains\Channel\Models\Client;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class ClientSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$siakad = Client::create([
|
|
'name' => 'SIAKAD',
|
|
'domain' => 'http://admin.siakad.test',
|
|
'webhook' => '/webhook',
|
|
'auth_type' => AuthType::NONE,
|
|
'credentials' => [],
|
|
'secret' => sha1('secret'.time())
|
|
]);
|
|
$pmb = Client::create([
|
|
'name' => 'PMB',
|
|
'domain' => 'http://pmb.test',
|
|
'webhook' => '/api/webhook',
|
|
'auth_type' => AuthType::NONE,
|
|
'credentials' => [],
|
|
'secret' => sha1('secret'.time())
|
|
]);
|
|
|
|
$apiEndpoints = [
|
|
[
|
|
'key' => ApiType::FACULTY,
|
|
'value' => '/InternalApi/list_data/fakultas',
|
|
'client_id' => $siakad->id
|
|
],
|
|
[
|
|
'key' => ApiType::STUDY_PROGRAM,
|
|
'value' => '/InternalApi/list_data/prodi',
|
|
'client_id' => $siakad->id
|
|
],
|
|
[
|
|
'key' => ApiType::TERM,
|
|
'value' => '/InternalApi/list_data/semester',
|
|
'client_id' => $siakad->id
|
|
],
|
|
[
|
|
'key' => ApiType::ADMISSION_TRACK,
|
|
'value' => '/api/jalur-pendaftaran',
|
|
'client_id' => $pmb->id
|
|
],
|
|
[
|
|
'key' => ApiType::ACADEMIC_PROGRAM,
|
|
'value' => '/api/sistem-kuliah',
|
|
'client_id' => $pmb->id
|
|
],
|
|
[
|
|
'key' => ApiType::ADMISSION_SCHEDULE,
|
|
'value' => '/api/jadwal-pendaftaran',
|
|
'client_id' => $pmb->id
|
|
],
|
|
[
|
|
'key' => ApiType::FEE_TYPE,
|
|
'value' => '/api/jenis-tagihan',
|
|
'client_id' => $pmb->id
|
|
],
|
|
[
|
|
'key' => ApiType::FEE_RATE,
|
|
'value' => '/api/biaya-pendaftaran',
|
|
'client_id' => $pmb->id
|
|
],
|
|
];
|
|
|
|
foreach ($apiEndpoints as $endpoint) {
|
|
ApiEndpoint::create($endpoint);
|
|
}
|
|
}
|
|
}
|
|
|