dbp/campusonline-api
PHP client for CAMPUSonline web services. Supports legacy REST endpoints, generic exports API, and legacy XML web services. Configure base URL and credentials/token, then access resources like UCard, exports, and organization units.
Pros:
Api facade, enabling selective adoption.kevinrob/guzzle-cache-middleware (v5–v7) for performance optimization, aligning with Laravel’s caching strategies (e.g., Redis, file cache).FilterBuilder for complex queries, reducing backend processing in Laravel.Cons:
HttpClient facade or GuzzleHttp\Client. Minimal conflict risk.getCardsForIdentIdObfuscated()). Laravel can map these to Eloquent models or DTOs via Collection transformations or API resources.json_encode()) for Laravel’s JSON responses.ApiException is HTTP-response-based; Laravel’s exception handling (e.g., render() in App\Exceptions\Handler) may need extension.config('cache.default')).GenericApi::getResource()) could overwhelm Laravel’s memory limits. Requires chunking or streaming.SimplePaginator).IdentIdObfuscated) that require additional encryption/decryption in Laravel?Dbp\CampusonlineApi\Rest\Api instance into Laravel services (e.g., app/Services/CampusonlineService) for business logic.HttpClient facade to wrap the package’s Guzzle client for consistency (optional).CampusonlineTokenManager.kevinrob/guzzle-cache-middleware to use Laravel’s cache store (e.g., Redis) via CacheMiddleware::withStore().ShouldQueue jobs.Course, User) with custom accessors/mutators for API-specific fields.campusonline database prefix to avoid naming conflicts.UCardApi, GenericApi, and LegacyWebService\Api for immediate use cases (e.g., student card validation, data exports).Campusonline::ucard()->getCardsForIdentIdObfuscated()) to abstract the package.PublicRestApi for modern endpoints (e.g., courses, rooms) once stability is confirmed.CourseResource, UserResource).config('app.php_version') aligns.guzzle-cache-middleware to avoid conflicts with Laravel’s cache (e.g., exclude Laravel’s cache keys from Guzzle’s cache).$client = new Client([
'middleware' => [
new CacheMiddleware([
'store' => new RedisStore(config('cache.redis')),
'expiration' => 60,
]),
],
]);
LengthAwarePaginator or SimplePaginator:
$data = $api->GenericApi('loc_apiMyExport')->getResource('ID', 42, ['limit' => 50]);
return new LengthAwarePaginator(
collect($data['results']),
$data['total'],
$data['limit'],
$data['page']
);
composer require dbp/campusonline-api.config/campusonline.php) for API endpoints/credentials.CampusonlineTokenManager) with refresh logic.encryption or sanctum).app/Services/Campusonline/UCardService).class UCardService {
public function __construct(private Api $api) {}
public function getCard(string $obfuscatedId): array {
return $this->api->UCard()->getCardsForIdentIdObfuscated($obfuscatedId);
}
}
class CampusonlineUser extends Model {
protected $fillable = ['person_uid', 'name', 'email'];
public static function fromApi(array $data): self {
return self::create([
'person_uid' => $data['personUid'],
'name' => $data
How can I help you explore Laravel packages today?