ingoldsby / laravel-dashboard-chuck-norris-joke-tile
A Chuck Norris joke tile for Laravel Dashboard
Requires
- php: ^7.4
- spatie/laravel-dashboard: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-11-10 17:12:24 UTC
README
This tile can be used on the Laravel Dashboard to display a random Chuck Norris joke from the internet Chuck Norris database.
Installation
You can install the package via composer:
composer require ingoldsby/laravel-dashboard-chuck-norris-joke-tile
Usage
In the dashboard
config file, you must add this configuration in the tiles
key.
// in config/dashboard.php return [ // ... 'tiles' => [ 'chuck_norris_joke' => [ 'refresh_interval_in_seconds' => 900, // this will refresh every 15 minutes ] ], ];
In app\Console\Kernel.php
you should schedule the \Ingoldsby\ChuckNorrisJokeTile\Commands\FetchChuckNorrisJokeCommand
to run. You can decide the frequency of running the command. There are approximately 600 jokes available through the API.
// in app/console/Kernel.php protected function schedule(Schedule $schedule) { // ... $schedule->command(\Ingoldsby\ChuckNorrisJokeTile\Commands\FetchChuckNorrisJokeCommand::class)->everyFifteenMinutes(); }
In your dashboard view you can use the tile:
livewire:chuck-norris-joke-tile
<x-dashboard> <livewire:chuck-norris-joke-tile position="a1" /> </x-dashboard>
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email instead of using the issue tracker.
Support Spatie
I have learnt a lot from Spatie's various packages, including Mailcoach, and would recommend you check them out if you want to know more.
Learn how to create a package like theirs, by watching Spatie's premium video course:
Spatie invest a lot of resources into creating best in class open source packages. You can support them by buying one of their paid products.
Credits
License
The MIT License (MIT). Please see License File for more information.