haythem / progress-bar
一个Laravel Nova的字段。
v2.0.3
2024-07-24 09:06 UTC
Requires
- php: ^7.3|^8.0
README
包描述:为laravel nova动态进度条字段
安装
通过composer安装
composer require haythem/progress-bar
设置路由
Route::get('/progressbar', function () {
return ["percentage" => rand(0, 100), "show" => true];
});
使用
use Haythem\ProgressBar\ProgressBar; public function fields(Request $request) { return [ ProgressBar::make('Progress Bar') ->endPoint('/api/progress') ->callEvery(500) ->markAsDone(false) ->barColor("#FFC0CB") ->barBackgroundColor("yellow") ->textColor('pink') ->initLabel("please wait") ->processingLabel("processing") ->doneLabel("all is good") ->redirectWhenItsDone("https://www.google.com",true) //second parameter is optional to open the url in new tab or in the same tab. ->reloadWhenItsDone() ->showProgressBarInForms(true) // you can show progress bar in forms. ->animation(),//show three dots animation when initializing and processing. ]; }