This package will not be updated without new maintainers, see: https://gitlab.com/tjvb/laravel-dashboard-packagist-tile/-/issues/10
This tile can be used on the Laravel Dashboard to show packagist statistics about the package you like to see. You can hide abandoned package and the totals for the packages. It also support pagination.
You can install the package via composer:
composer require tjvb/laravel-dashboard-packagist-tile
In the dashboard
config file, you must add this configuration in the tiles
key. And customize it for your own needs.
// in config/dashboard.php
return [
'tiles' => [
'packagist' => [
'refresh_interval_in_seconds' => 300,
'sort' => 'total', // options: name, daily, monthly, total, empty means no sorting.
'reverse' => true, // reverse the order
'with_abandoned' => true, // set to false to ignore them
'display' => [
'totals' => true,
'faves' => true, // packagist faces
'github_stars' => true, // github stars
],
'vendors' => [ // vendors from which you want to see all the packages
'tjvb',
'spatie',
],
'packages' => [ // specific packages that you want to see.
'phpmd/phpmd',
'pdepend/pdepend',
],
],
],
];
To load the data from packagist there are two commands to schedule. The FetchPackageDataCommand gets the statistics for the package. This is cached for twelve hours so it isn't usefull to get it more then twice a day. See the Packagist API documentation
The second command is to get the packages for the vendors that you have configured. If you create a lot of packages like the great people from Spatie it can be usefull to automate it. Else it is preferable to run php artisan dashboard:fetch-vendor-packages-from-packagist
after you publish a new package on packagist.
// in app/console/Kernel.php
protected function schedule(Schedule $schedule)
{
// ...
$schedule->command(\TJVB\PackagistTile\FetchPackageDataCommand::class)->twiceDaily();
// Additional if the vendors you watch release a lot of packages.
// Else be nice and do it manually with php artisan dashboard:fetch-vendor-packages-from-packagist.
// $schedule->command(\TJVB\PackagistTile\FetchVendorPackagesCommand::class)->daily();
}
In your dashboard view you use the livewire:packagist-tile
component.
<x-dashboard>
<livewire:packagist-tile position="e7:e16" />
</x-dashboard>
The packages are paginated, by default a page has a maximum of 10 packages. This can be changed with adding a perPage property to the tile.
<x-dashboard>
<livewire:packagist-tile position="e7:e16" perPage="2" />
</x-dashboard>
If you want to customize the view used to render this tile, run this command:
php artisan vendor:publish --provider="TJVB\PackagistTile\PackagistTileServiceProvider" --tag="dashboard-packagist-views"
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
- Spatie for the dashboard and packagist api package.
- Packagist for the great service.
- Frontend preset for Tailwind CSS For the pagination preset.
The MIT License (MIT). Please see License File for more information.