https://github.com/salimromadhon/php-telegraph-client
The PHP Telegraph Client is a set of simple classes to interact with Telegra.ph.
https://github.com/salimromadhon/php-telegraph-client
telegram telegraph telegraph-api telegraph-client
Last synced: 5 months ago
JSON representation
The PHP Telegraph Client is a set of simple classes to interact with Telegra.ph.
- Host: GitHub
- URL: https://github.com/salimromadhon/php-telegraph-client
- Owner: salimromadhon
- License: mit
- Created: 2023-01-02T06:43:18.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T12:29:14.000Z (over 3 years ago)
- Last Synced: 2024-11-13T19:11:41.530Z (over 1 year ago)
- Topics: telegram, telegraph, telegraph-api, telegraph-client
- Language: PHP
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP Telegraph Client
The PHP Telegraph Client is a set of simple classes to interact with [Telegra.ph](https://telegra.ph/).
## Installation
```
composer require salimid/php-telegraph-client
```
## Usage
``` php
use SalimId\Telegraph\Account;
use SalimId\Telegraph\Page;
$account = Account::create([
'short_name' => 'John',
'author_name' => 'John Doe',
]);
$account = Account::find('d3b25feccb89e508a9114afb82aa421fe2a9712b963b387cc5ad71e58722');
$account->short_name = 'JD';
$account->save()->revoke();
$page = $account->page()->create(['title' => 'Hello World']);
$pages = $account->pages();
$page = $pages->first()->refresh();
$page->title = 'My First Post';
$page->save();
$account->use();
$page = Page::find('Path-to-Page-XX-XX');
$page = new Page;
$page->title = 'My Second Post';
$page->save();
$popular = $account->pages()->sortBy('views')->reverse()->first()->refresh();
$popular->title = 'This Post Got ' . $popular->views . ' Views';
$popular->save();
```
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.