Skip to content

Ronildo-Sousa/devto-for-laravel

Repository files navigation

Dev.to for Laravel

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.

About

A service wrapper around the Dev.to

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages