Download the PHP package katalam/laravel-onoffice-adapter without Composer
On this page you can find all versions of the php package katalam/laravel-onoffice-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download katalam/laravel-onoffice-adapter
More information about katalam/laravel-onoffice-adapter
Files in katalam/laravel-onoffice-adapter
Package laravel-onoffice-adapter
Short Description This is my package laravel-onoffice-adapter
License MIT
Homepage https://github.com/katalam/laravel-onoffice-adapter
Informations about the package laravel-onoffice-adapter
onOffice Adapter for Laravel
A query builder for the onOffice API with an Eloquent-style interface.
Features
- Query builder -
select(),where(),orderBy(),limit(),offset() - Repositories - Estates, addresses, activities, appointments, tasks, search criteria, files, relations, and more
- Pagination -
get()reads every page;each()processes one page at a time - Middlewares - Run code before and after each request
- Testing - Fake responses and record factories
- Files - Upload, chunk, and link files to records
- Read-only mode - Refuse every write, globally, per credentials, or per query
Installation
Add your onOffice API credentials to .env:
Requests go to https://api.onoffice.de/api/stable/api.php. Set ON_OFFICE_BASE_URL to use another API version or a proxy.
To change retry settings or headers, publish the config file:
The package keeps one HTTP connection to the onOffice API open per PHP process and reuses it for every request, which skips the TCP and TLS handshake on all but the first call. Long-lived processes such as queue workers and Octane benefit most. If a stale connection is closed by the server, the request fails with a connection error and the retry settings above take over. Set reuse_connection to false in the config to open a fresh connection per request instead.
Usage
Basic Queries
Building Queries
Chain methods to filter, sort, and limit results:
Available Methods
| Method | Description |
|---|---|
select($fields) |
Fields to retrieve |
where($field, $op, $value) |
Filter by condition |
whereIn($field, $values) |
Filter by array of values |
whereLike($field, $pattern) |
Pattern matching |
whereBetween($field, $min, $max) |
Range filter |
orderBy($field) |
Sort ascending |
orderByDesc($field) |
Sort descending |
limit($n) |
Max results |
offset($n) |
Skip results |
Large Datasets
each() processes one page per callback:
A failed page throws OnOfficeException. No partial results. Chunks already passed to the callback are not rolled back.
Available Repositories
| Repository | Description |
|---|---|
EstateRepository |
Real estate properties |
AddressRepository |
Contacts and addresses |
ActivityRepository |
Activity logs |
ActionRepository |
Action kind types |
AppointmentRepository |
Calendar appointments |
TaskRepository |
Tasks |
UserRepository |
onOffice users |
SearchCriteriaRepository |
Buyer search profiles |
FieldRepository |
Field metadata |
FileRepository |
File uploads and downloads |
FilterRepository |
Saved filters |
RelationRepository |
Record relationships |
SettingRepository |
System settings |
MarketplaceRepository |
Marketplace integration |
LinkRepository |
URL links |
LogRepository |
Log entries |
MacroRepository |
Macros |
LastSeenRepository |
Recently viewed records |
File Uploads
save() checks the size onOffice reports after the last block. If a block arrived twice or not at all, it starts over once from a new temporary file, then throws IncompleteUploadException instead of linking a corrupt file.
Creating Activities
Middlewares
Run code before each request:
Read-Only Mode
Refuses every mutating action (create, modify, delete and do) before it
is sent and throws a ReadOnlyViolationException. Reads are unaffected.
Any layer can turn it on, none can turn it off.
Debugging
Helpers
Default field lists and empty-value cleanup:
Testing
Fake responses in tests:
Prevent Unstubbed Requests
Multiple Pages
Sequences (Multiple Calls)
See Testing for factories and assertions.
Development
Changelog
See UPGRADE.
Security Vulnerabilities
See the security policy.
Credits
- Bruno Görß
- All Contributors
License
MIT. See LICENSE.
All versions of laravel-onoffice-adapter with dependencies
illuminate/contracts Version ^10.0||^11.0
spatie/laravel-package-tools Version ^1.16