statview / satellite
该软件包最新版本(1.3.0)没有可用的许可信息。
Statview的卫星软件包
1.3.0
2024-03-31 20:13 UTC
Requires
- illuminate/contracts: ^9.0 || ^10.0 || ^11.0
Requires (Dev)
- orchestra/testbench: ^8.0.10
- pestphp/pest: ^2.9
- pestphp/pest-plugin-laravel: ^2.0
- spatie/laravel-ray: ^1.32.4
README
设置Statview通信通道的软件包。更多信息请访问 https://statview.app。
安装
Composer require
composer require statview/satellite
发布供应商
php artisan vendor:publish --tag="statview-config"
添加环境变量
您可以在Statview的项目设置期间获取变量数据。
STATVIEW_DSN=
维护模式
如果您想在Statview面板中关闭维护模式,则需要为Statview设置一个例外,以便在维护模式下访问您的应用程序。
将statview添加到您的PreventRequestsDuringMaintenance
中间件的$except
数组中。
/** * The URIs that should be reachable while maintenance mode is enabled. * * @var array<int, string> */ protected $except = [ '/statview/*' ];
用法
为小部件提供数据
您可以通过将其添加到服务提供者中注册您的小部件。
use Statview\Satellite\Statview; public function boot() { Statview::registerWidgets(function () { return [ Widget::make('total_users') ->title('Total users') ->value(User::count()) ->description('All the users since start of the project'), Widget::make('total_teams') ->title('Total teams') ->value(Team::count()), Widget::make('total_projects') ->title('Total projects') ->value(Project::count()), ]; }); }
向您的时间线发送消息
向您的时间线发送消息非常简单。Satellite软件包已经内置了所有功能,可以开始向您的时间线发送消息。
use Statview\Satellite\Statview; Statview::postToTimeline( title: 'Houston, we have a problem', body: 'There is a problem with renewing subscriptions.', type: 'danger' // Defaults to info, icon: '🚨' // Expects emoji string - defaults to 📣, );
支持
请发送电子邮件至support[at]statview.app。我们很乐意为您提供帮助。