This commit is contained in:
iVampireSP.com 2023-02-02 20:11:53 +08:00
parent 4b5ba18b29
commit c2894f5114
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -52,8 +52,10 @@ protected static function boot()
$model->api_token = Str::random(60);
}
// 如果结尾有 / 则去掉
$model->url = rtrim($model->url, '/');
// 如果设置了 url 并且结尾有 / 则去掉
if ($model->url) {
$model->url = rtrim($model->url, '/');
}
});
static::updating(function (self $model) {
// 如果结尾有 / 则去掉