Download the PHP package sissokho/laravel-dev-joke without Composer
On this page you can find all versions of the php package sissokho/laravel-dev-joke. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sissokho/laravel-dev-joke
More information about sissokho/laravel-dev-joke
Files in sissokho/laravel-dev-joke
Package laravel-dev-joke
Short Description This package offer a simple way to fetch a random dev joke from the DevJoke API
License MIT
Homepage https://github.com/sissokho/laravel-dev-joke
Informations about the package laravel-dev-joke
Laravel Dev Joke
This package offer a simple way to fetch a random dev joke from this DevJoke API.
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
You can install the package via composer:
Usage
This package can be used by resolving the Sissokho\LaravelDevJoke\DevJoke
class from the container or by injecting it into a method:
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:
Artisan
An artisan command is provided for you to display a random joke:
The joke is displayed like this:
Testing
You can run PHPUnit tests, PHPStan/Larastan static analysis and inspect the code for style errors without changing the files (with Laravel Pint):
However, you can run these tests separately.
-
Static analysis:
-
PHPUnit tests:
- Code inspection:
To fix code style issues, run the following command:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
Huge thanks to @askudhay for providing this API.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-dev-joke with dependencies
illuminate/console Version ^9.0 || ^10.0
illuminate/support Version ^9.0 || ^10.0