You can install the package via composer:
composer require ova-studio/ips-api
In config/services.php
:
'ips' => [
// ... other options
'base_uri' => env('IPS_BASE_URI'),
'api_key' => env('IPS_API_KEY'),
'default_user' => env('IPS_DEFAULT_USER_ID')
]
Basic usage:
$api = new IpsApi();
$to_user_id = 1;
$api->system()->messages()->create($to_user_id, 'Message title', 'Message body');
By default, message is sent from default user from config file.
If you want to send message from another user, you can set user id with
withSender
method.
$api = new IpsApi();
$from_user_id = 1;
$to_user_id = 1;
$api->system()->messages()->withSender($from_user_id)->create($to_user_id, 'Message title', 'Message body');
Basic usage:
$api = new IpsApi();
$topic_id = 1;
$api->forums()->posts()->create($topic_id, '<p>Message HTML body</p>');
By default, message is sent from default user from config file.
If you want to send message from another user, you can set user id with
withAuthor(int $author, ?string $author_name = null)
method.
If author ID is equal 0, author name is required.
$api = new IpsApi();
$from_user_id = 1;
$topic_id = 1;
$api->forums()->posts()
->withAuthor($from_user_id) // or ->withAuthor(0, 'Somename')
->create($to_user_id, 'Message title', 'Message body');
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.