From a1173572db21ba1440e91b3348dd07a3bed0fc16 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Mon, 8 Jul 2024 10:11:25 +0800 Subject: [PATCH] update readme.md --- README.md | 26 +++++++++++++++++++- app/Casts/StorageFile.php | 51 --------------------------------------- 2 files changed, 25 insertions(+), 52 deletions(-) delete mode 100644 app/Casts/StorageFile.php diff --git a/README.md b/README.md index e028621..9e50b31 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,28 @@ - PHP >= 8.2 - laravel/framework: ^11.x -- slowlyo/owl-admin: ^3.8 \ No newline at end of file +- slowlyo/owl-admin: ^3.8 + +## Helpers + +### 上传文件 + +修改文件上传接口 `admin-api/upload_file`, `admin-api/upload_image`, 返回完整链接 + +- `app\Admin\Controllers\HomeController.php@upload` + +### SQL 日志 + +监听sql执行, 打印日志 + +- `app/Providers/QueryLogServiceProvider.php` + +### 无限级分类 + +- `app/Traits/TreePath.php` + +| column | name | comment | +| - | - | - | +| parent_id | 上级id | 默认: 0 | +| path | 所有上级id | 默认: -, 例如: -1-2-3- | +| sort | 排序 | 正序 | diff --git a/app/Casts/StorageFile.php b/app/Casts/StorageFile.php deleted file mode 100644 index 0150df5..0000000 --- a/app/Casts/StorageFile.php +++ /dev/null @@ -1,51 +0,0 @@ -disk = $disk; - } - - /** - * Cast the given value. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string $key - * @param mixed $value - * @param array $attributes - * @return array - */ - public function get($model, $key, $value, $attributes) - { - return $value ? (Str::startsWith($value, ['http://', 'https://']) ? $value : Storage::disk($this->disk)->url($value)) : null; - } - - /** - * Prepare the given value for storage. - * - * @param \Illuminate\Database\Eloquent\Model $model - * @param string $key - * @param array $value - * @param array $attributes - * @return string - */ - public function set($model, $key, $value, $attributes) - { - return $value; - } -}