PHPackages                             sissokho/laravel-dev-joke - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. sissokho/laravel-dev-joke

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

sissokho/laravel-dev-joke
=========================

This package offer a simple way to fetch a random dev joke from the DevJoke API

v2.0.0(2y ago)44[1 PRs](https://github.com/sissokho/laravel-dev-joke/pulls)MITPHPPHP ^8.1 || ^8.2

Since Aug 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/sissokho/laravel-dev-joke)[ Packagist](https://packagist.org/packages/sissokho/laravel-dev-joke)[ Docs](https://github.com/sissokho/laravel-dev-joke)[ RSS](/packages/sissokho-laravel-dev-joke/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (5)Used By (0)

Laravel Dev Joke
================

[](#laravel-dev-joke)

[![Latest version on packagist](https://camo.githubusercontent.com/5afb774ca892a45c02e8772ecf87f72d057e8add091afddfc69ab83981c7d294/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736973736f6b686f2f6c61726176656c2d6465762d6a6f6b653f636f6c6f723d626c7565267374796c653d666c61742d737175617265)](https://packagist.org/packages/sissokho/laravel-dev-joke)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Unit Tests](https://github.com/sissokho/laravel-dev-joke/actions/workflows/run-tests.yml/badge.svg)](https://github.com/sissokho/laravel-dev-joke/actions/workflows/run-tests.yml/badge.svg)[![Static Analysis](https://github.com/sissokho/laravel-dev-joke/actions/workflows/static-analysis.yml/badge.svg)](https://github.com/sissokho/laravel-dev-joke/actions/workflows/static-analysis.yml/badge.svg)

This package offer a simple way to fetch a random dev joke from this [DevJoke API](https://documenter.getpostman.com/view/16443297/TzkyLee7).

Prerequisites
-------------

[](#prerequisites)

This package requires:

- PHP 8.1 or higher
- Laravel 9.0 or higher

If you are on the PHP version 8.0 just use an older version of this package.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require sissokho/laravel-dev-joke
```

Usage
-----

[](#usage)

This package can be used by resolving the `Sissokho\LaravelDevJoke\DevJoke` class from the container or by injecting it into a method:

```
use Sissokho\LaravelDevJoke\DevJoke;

public function joke(DevJoke $devJoke)
{
    $joke = $devJoke->random();

    $joke->question; // retrieve the question
    $joke->punchline; // retrieve the punchline
    $joke->toArray(); // ['question' => 'lorem', 'punchline' => 'ipsum']
}
```

The `randomJoke` method will return a `Sissokho\LaravelDevJoke\DataTransferObjects\Joke` object, which includes the question and the punchline of the joke;

You can also use the Facade:

```
use Sissokho\LaravelDevJoke\Facades\DevJoke;

$joke = DevJoke::random();
```

Artisan
-------

[](#artisan)

An artisan command is provided for you to display a random joke:

```
php artisan devjoke
```

The joke is displayed like this:

[![Screenshot from 2022-08-27 15-19-32](https://user-images.githubusercontent.com/31145894/187036552-5a211546-d02c-418c-8cf5-73d167166540.png)](https://user-images.githubusercontent.com/31145894/187036552-5a211546-d02c-418c-8cf5-73d167166540.png)

Testing
-------

[](#testing)

You can run PHPUnit tests, PHPStan/Larastan static analysis and inspect the code for style errors without changing the files (with Laravel Pint):

```
composer test
```

However, you can run these tests separately.

- Static analysis:

```
composer test:types
```

- PHPUnit tests:

```
composer test:unit
```

- Code inspection:

```
composer test:style
```

To fix code style issues, run the following command:

```
composer stylefix
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](./CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Mouhamadou Moustapha SISSOKHO](https://github.com/sissokho)

Huge thanks to [@askudhay](https://twitter.com/askudhay) for providing this API.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](./LICENSE.md) for more information.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 86.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~143 days

Total

3

Last Release

1069d ago

Major Versions

v0.1.0 → v1.0.02022-08-29

v1.0.0 → v2.0.02023-06-08

PHP version history (2 changes)v0.1.0PHP ^8.0

v2.0.0PHP ^8.1 || ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c73938355640e41cfbf8d2f3971ec87cd6c814f564d8863e5406026fbf52c49a?d=identicon)[sissokho](/maintainers/sissokho)

---

Top Contributors

[![sissokho](https://avatars.githubusercontent.com/u/31145894?v=4)](https://github.com/sissokho "sissokho (33 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")

---

Tags

integrationsissokholaravel-dev-jokedev-joke-api

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/sissokho-laravel-dev-joke/health.svg)

```
[![Health](https://phpackages.com/badges/sissokho-laravel-dev-joke/health.svg)](https://phpackages.com/packages/sissokho-laravel-dev-joke)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[pulkitjalan/ip-geolocation

IP Geolocation Wrapper with Laravel Support

89164.9k1](/packages/pulkitjalan-ip-geolocation)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
