https://github.com/spatie/laravel-dashboard-coffee-tile
Show caffeine intake stats for our office coffee machine
https://github.com/spatie/laravel-dashboard-coffee-tile
coffee dashboard laravel php tile
Last synced: 6 months ago
JSON representation
Show caffeine intake stats for our office coffee machine
- Host: GitHub
- URL: https://github.com/spatie/laravel-dashboard-coffee-tile
- Owner: spatie
- License: mit
- Created: 2021-11-04T14:37:23.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T11:53:10.000Z (about 2 years ago)
- Last Synced: 2025-04-02T03:43:16.340Z (7 months ago)
- Topics: coffee, dashboard, laravel, php, tile
- Language: PHP
- Homepage: https://spatie.be/docs/laravel-dashboard
- Size: 36.1 KB
- Stars: 2
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Coffee brewing statistics for the Spatie office
[](https://packagist.org/packages/spatie/laravel-dashboard-coffee-tile)
[](https://packagist.org/packages/spatie/laravel-dashboard-coffee-tile)Over at Spatie we drink a lot of coffee. How much coffee? We had no idea until we created this dashboard tile.
Using a separate Raspberry Pi running [this Python script](https://github.com/spatie/dashboard-coffee-listener/) we can listen to the sounds our office coffee machine makes and update the dashboard tile with the latest statistics.
This tile can be used on [the Laravel Dashboard](https://docs.spatie.be/laravel-dashboard).

## Support us
[
](https://spatie.be/github-ad-click/laravel-dashboard-skeleton-tile)
We invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support us by [buying one of our paid products](https://spatie.be/open-source/support-us).
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://spatie.be/about-us). We publish all received postcards on [our virtual postcard wall](https://spatie.be/open-source/postcards).
## Installation and usage
You can install the package via composer:
```bash
composer require spatie/laravel-dashboard-coffee-tile
```You will also need to publish and run the migrations:
```bash
php artisan vendor:publish --provider="Spatie\CoffeeTile\CoffeeTileServiceProvider" --tag="coffee-tile-migrations"
php artisan migrate
```In your dashboard view you can add the `livewire:coffee-tile` component. The `total-offset` will offset the total amount of brewed coffees and is optional.
```html
```
Finally, coffees are counted by POST requests to the included `CoffeeController`. Add the following route to your `routes/api.php` file. Endpoint authentication is up to you. Make sure to add a `auth` middleware to this route if you feel it's necessary.
```php
Route::post('/coffee', \Spatie\CoffeeTile\Http\CoffeeController::class);
```Additionally, you'll need something to hook up your coffee machine to this coffee endpoint. Your machine might have a very cool web UI that can send a webhook to the dashboard or you might need to get creative with an Arduino or Raspberry Pi.
Our set-up uses a Raspberry Pi to listen to the coffee machine noises to determine when a cup is brewing. This is a separate project that can be found [here](https://github.com/spatie/dashboard-coffee-listener).
## Testing
``` bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/spatie/.github/blob/main/CONTRIBUTING.md) for details.
## Security
If you discover any security related issues, please email alex@spatie.be instead of using the issue tracker.
## Credits
- [Alex Vanderbist](https://github.com/AlexVanderbist)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.