Official PHP SDK for the NewTqnia APIs. Retrieve bilingual technology news and integrate NewTqnia into PHP and Laravel applications.
newtqnia/php is a Laravel package for official php sdk for the newtqnia apis. retrieve bilingual technology news and integrate newtqnia into php and laravel applications..
It currently has 0 GitHub stars and 0 downloads on Packagist (latest version v1.0.0).
Install it with composer require newtqnia/php.
Discover more Laravel packages by newtqnia
or browse all Laravel packages to compare alternatives.
Last updated
The official PHP SDK for the NewTqnia technology news API, providing structured access to bilingual technology news for PHP and Laravel applications.

When API content is displayed, the API terms require a visible Powered by NewTqnia link and preservation of the returned article URLs.
ETag, If-None-Match, 304, and Cache-ControlPHP 8.2 or later and a PSR-18 implementation:
composer require newtqnia/php guzzlehttp/guzzle
<?php
require __DIR__.'/vendor/autoload.php';
use NewTqnia\Client;
$client = new Client();
$response = $client->news()->today(locale: 'en', limit: 5);
foreach ($response->articles as $article) {
echo $article->title.PHP_EOL;
echo $article->url.PHP_EOL;
}
Explicit PSR injection is also supported:
$client = new Client(httpClient: $psr18Client, requestFactory: $psr17Factory);
Laravel discovers the package automatically. Optionally publish its configuration:
php artisan vendor:publish --tag=newtqnia-config
NEWTQNIA_BASE_URL=https://newtqnia.com
NEWTQNIA_API_KEY=
NEWTQNIA_CACHE_ENABLED=true
NEWTQNIA_CACHE_TTL=300
use NewTqnia\Laravel\Facades\NewTqnia;
$digest = NewTqnia::news()->latest(locale: 'en', limit: 6);
Render the required attribution with <x-newtqnia-attribution />.
The integration was verified in a temporary Laravel 12 application installed through a Composer path repository. It rendered live API data in desktop, mobile, dashboard, and Arabic RTL layouts:
| Mobile | Arabic RTL | Developer dashboard |
| --- | --- | --- |
|
|
|
|
$today = $client->news()->today(locale: 'en', limit: 5);
$latest = $client->news()->latest(locale: 'ar', limit: 5);
$ai = $client->news()->latest(locale: 'en', limit: 10, category: 'ai');
$fluent = $client->news()->latest()
->locale('ar')
->limit(5)
->category('security')
->get();
Valid locales are en and ar; limits are 1–10. Category values are API category slugs.
Digest exposes the documented API version, collection, optional date, timezone, locale, direction, publisher, attribution, generation time, articles, and links. Each Article exposes its ID, title, summary, category, image URL, preserved article URL, publication time, and read time. Use $digest->raw() when the original decoded response is needed.
Pass any Psr\SimpleCache\CacheInterface implementation as cache:. Successful responses are cached, server max-age is honored, stale entries are revalidated with their ETag, and errors are never cached. The public API is limited to 60 requests per minute per IP.
Failures use the NewTqnia\Exception hierarchy: ValidationException, TransportException, InvalidResponseException, ApiException, RateLimitException, and ConfigurationException. See caching and error handling.
Applications displaying API content must visibly link “Powered by NewTqnia” to NewTqnia. The core helper is:
$attribution = \NewTqnia\NewTqnia::attribution();
The SDK never rewrites article URLs. Review the attribution guide and API terms.
The small runtime dependency set has one job each:
psr/http-client and psr/http-factory define the interoperable HTTP transport contracts (their standard contracts bring PSR-7 messages transitively).php-http/discovery finds an installed PSR-18 client and PSR-17 factory for zero-configuration construction; explicit injection remains supported.psr/simple-cache powers the implemented, optional ETag response cache.Laravel, Guzzle, PHPUnit, PHPStan, and PHP CS Fixer are development-only. The core has no framework, logging, serializer, date, or collection dependency.
composer check
NEWTQNIA_LIVE_TESTS=1 vendor/bin/phpunit tests/Integration/LiveApiTest.php
composer openapi:check
See CONTRIBUTING.md, SECURITY.md, and the MIT license.