ronildo-sousa/devto-for-laravel

A service wrapper around the Dev.to

0.0.1 2023-05-09 18:12 UTC

This package is auto-updated.

Last update: 2024-11-20 03:20:12 UTC


README

Latest Version on Packagist Total Downloads

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.