├── .gitignore ├── version.php ├── resources ├── views │ └── index.blade.php └── assets │ ├── css │ └── viewer.min.css │ └── js │ └── viewer.min.js ├── src ├── Setting.php ├── LightboxServiceProvider.php ├── LightboxDisplayer.php └── LightboxField.php ├── README.md ├── composer.json └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | phpunit.phar 3 | /vendor 4 | composer.phar 5 | composer.lock 6 | *.project 7 | .idea/ -------------------------------------------------------------------------------- /version.php: -------------------------------------------------------------------------------- 1 | [ 5 | 'Initialize extension.', 6 | ], 7 | ]; 8 | -------------------------------------------------------------------------------- /resources/views/index.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Welcome to dcat-admin ! 3 |
4 | 5 | 10 | 11 | 14 | -------------------------------------------------------------------------------- /src/Setting.php: -------------------------------------------------------------------------------- 1 | text('key1')->required(); 12 | $this->text('key2')->required(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dcat Admin 图片预览扩展 2 | 3 | #### 安装 4 | ``` 5 | composer require abovesky/dcat-lightbox 6 | ``` 7 | 8 | >具体安装方法请参考官方文档 9 | 10 | #### 使用方法 11 | ```$xslt 12 | // 数据表格中使用 13 | $grid->column('images')->lightbox(); 14 | 15 | //设置服务器和宽高 16 | $grid->column('images')->lightbox('http://xxx.com', 100, 100); 17 | 18 | // 数据详情中使用 19 | $show->field('images')->lightbox(); 20 | ``` 21 | 22 | >当字段为数组时为多图浏览 23 | 24 | #### License 25 | 26 | Licensed under The [MIT License (MIT). ](https://github.com/dcat-admin-extensions/lightbox/blob/master/LICENSE) 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/LightboxServiceProvider.php: -------------------------------------------------------------------------------- 1 | =7.1.0", 16 | "dcat/laravel-admin": "~2.0" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "Abovesky\\DcatAdmin\\Lightbox\\": "src/" 21 | } 22 | }, 23 | "extra": { 24 | "dcat-admin": "Abovesky\\DcatAdmin\\Lightbox\\LightboxServiceProvider", 25 | "laravel": { 26 | "providers": [ 27 | "Abovesky\\DcatAdmin\\Lightbox\\LightboxServiceProvider" 28 | ] 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Tian Shaofeng 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/LightboxDisplayer.php: -------------------------------------------------------------------------------- 1 | id = 'viewer-' . Str::random(8); 18 | 19 | return <<