a2sc/chuck-norris-jokes

Create random Chuck Norris jokes.

2.1.0 2020-01-23 04:21 UTC

This package is auto-updated.

Last update: 2024-05-25 11:47:59 UTC


README

Create random Chuck Norris Jokes using the API from The Internet Chuck Norris Database

Latest Version on Packagist Build Status

Purpose

This package is a test example package from the Marcel Pociot's PHP Package Development Serie. The must see serie to learn how to create a package!

This is the "Hello World" package build within the serie to learn how to properly create a PHP package and publish it on Packagist and understand all the caveats.

Requirement

PHP version 7.2+

Installation

Via Composer

composer require a2sc/chuck-norris-jokes

Usage

use A2sc\ChuckNorrisJokes\JokeFactory;

$jokes = new JokeFactory();

$joke = $jokes->getRandomJoke();

Within Laravel project:

You can use the Facade:

$joke = ChuckNorris::getRandomJoke();

You can use artisan command:

php artisan chuck-norris

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT