digram/bukua-access
Composer 安装命令:
composer require digram/bukua-access
包简介
Access Bukua Edtech API services for your Laravel application
README 文档
README
A Laravel package for integrating with Bukua Edtech API services, providing easy access to schools data.
Features
- Authentication with Bukua API using client credentials
- Simple methods to fetch paginated schools data
Prerequisites
Before using this package, ensure you have:
-
Bukua Developer Account
- Register as an app developer at Bukua Platform - Development Environment or Bukua Platform - Production Environment
- Create a Core Access App in the selected environment above
-
Application Credentials
- Obtain your
client_idandclient_secretfrom the Bukua Developer Dashboard
- Obtain your
-
Laravel Application
- Laravel 8.x or higher
- Composer for dependency management
Configuration
- Add the following to your
.envfile:
BUKUA_CORE_ACCESS_CLIENT_ID=your-client-id BUKUA_CORE_ACCESS_CLIENT_SECRET=your-client-secret BUKUA_BASE_URL="https://bukua-core.apptempest.com" # Development # BUKUA_BASE_URL="https://app.bukuaplatform.com" # Production
Installation
- In your terminal, run
composer require digram/bukua-access
-
Clear your configuration cache by running
# For development php artisan config:clear && php artisan route:clear # For production php artisan config:cache && php artisan route:cache
Usage
Counties
Get a paginated list of counties:
- App permission:
county:view
use BukuaAccess\Facades\BukuaAccess; try { $counties = BukuaAccess::counties(page: 1, per_page: 100); print_r($counties); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Subjects
Get a paginated list of subjects:
- App permission:
subject:view
use BukuaAccess\Facades\BukuaAccess; try { $subjects = BukuaAccess::subjects(page: 1, per_page: 100); print_r($subjects); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
TVETs
Get a paginated list of TVET institutions:
- App permission:
tvet:view
use BukuaAccess\Facades\BukuaAccess; try { $tvets = BukuaAccess::tvets(page: 1, per_page: 100); print_r($tvets); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Academic Year / Term Dates
Get the current academic year and term dates
- App permission: None
use BukuaAccess\Facades\BukuaAccess; try { $academicYear = BukuaAccess::academicYear(); print_r($academicYear); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Schools
Get a paginated list of schools:
- App permission:
school:view
use BukuaAccess\Facades\BukuaAccess; try { $schools = BukuaAccess::schools(page: 1, per_page: 100); print_r($schools); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Schools with Subjects
Get a paginated list of schools with subjects taught:
- App permission:
school:view
use BukuaAccess\Facades\BukuaAccess; try { $schoolsWithSubjects = BukuaAccess::schoolsWithSubjects(page: 1, per_page: 100); print_r($schoolsWithSubjects); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Schools with Subject Combinations
Get a paginated list of schools with subjects combinations:
- App permission:
school:view
use BukuaAccess\Facades\BukuaAccess; try { $schoolsWithSubjectCombinations = BukuaAccess::schoolsWithSubjectCombinations(page: 1, per_page: 100); print_r($schoolsWithSubjectCombinations); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Schools with Profiles
Get a paginated list of schools with profiles such as mission statement, fee structure, logo etc:
- App permission:
school:view
use BukuaAccess\Facades\BukuaAccess; try { $schoolsWithProfiles = BukuaAccess::schoolsWithProfiles(page: 1, per_page: 100); print_r($schoolsWithProfiles); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Schools with Departments
Get a paginated list of schools with departments:
- App permission:
school:view
use BukuaAccess\Facades\BukuaAccess; try { $schoolsWithDepartments = BukuaAccess::schoolsWithDepartments(page: 1, per_page: 100); print_r($schoolsWithDepartments); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
Update Basic School Information
Updates basic school information for a specified school.
Request
Required Permissions
school_info:update- Application must have this permission to access the endpoint
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
school_uid |
string | Yes | Unique identifier of the school (UUID format) |
data |
array | Yes | Array containing the fields to update |
Supported Data Fields
| Field | Type | Description |
|---|---|---|
clean_name |
string | Presentable, formatted school name |
short_name |
string | Shortened version of the clean name (for space-constrained displays) |
abbreviation |
string | School abbreviation or acronym |
domain |
string | School website domain |
national_code |
string | KNEC code |
year_established |
integer | Year the school was established |
Example Usage
use BukuaAccess\Facades\BukuaAccess; try { $response = BukuaAccess::updateSchoolInfo( school_uid: 'efd8cccf-861f-4392-8e77-6a08b056e65e', data: [ 'domain' => 'jitahidischool', 'clean_name' => 'Jitahidi Senior School', 'year_established' => 2000, ] ); print_r($response); } catch (\Exception $e) { echo "Error: " . $e->getMessage(); }
digram/bukua-access 适用场景与选型建议
digram/bukua-access 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 57 次下载、GitHub Stars 达 1, 最近一次更新时间为 2025 年 05 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「apis」 「kenya」 「edtech」 「bukua」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 digram/bukua-access 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 digram/bukua-access 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 digram/bukua-access 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
An API Development Kit (ADK) to consistently build and manage APIs
An HTTP Kipchak driver (dependency) for the Kipchak API Development Kit (ADK)
A Logging Kipchak driver (dependency) for the Kipchak API Development Kit (ADK)
A File based Caching Kipchak driver (dependency) for the Kipchak API Development Kit (ADK)
A Kipchak Memcached driver (dependency) for the Kipchak API Development Kit (ADK)
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-05-09