a2sc / chuck-norris-jokes
Create random Chuck Norris jokes.
Requires
- guzzlehttp/guzzle: ^6.5
Requires (Dev)
- orchestra/testbench: ^4.0
- phpunit/phpunit: ^8.5
This package is auto-updated.
Last update: 2024-12-25 13:10:00 UTC
README
Create random Chuck Norris Jokes using the API from The Internet Chuck Norris Database
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.