ronildo-sousa / devto-for-laravel
A service wrapper around the Dev.to
0.0.1
2023-05-09 18:12 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.5
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
This package is auto-updated.
Last update: 2024-11-20 03:20:12 UTC
README
A service wrapper around the Dev.to API
🛠️ In progress
Installation
You can install the package via composer:
composer require ronildo-sousa/devto-for-laravel
Usage
See the documentation for details
Published articles
This allows the client to retrieve a list of articles.
DevtoForLaravel::articles() ->get();
you have some options like:
Pagination
DevtoForLaravel::articles() ->perPage(5) ->get();
Filters
DevtoForLaravel::articles() ->withTags(['tag1', 'tag2']) ->withoutTags(['tag3', 'tag4']) ->get();
DevtoForLaravel::articles() ->from('username') ->get();
Sort articles
This allows to retrieve a list of articles. ordered by descending publish date.
DevtoForLaravel::articles() ->latest() ->get();
Find by ID
you can get an article by id:
DevtoForLaravel::articles() ->find(258)
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.