Browse Source

Merge branch 'master' of http://git.9026.com/swdz-WangHaijun/BaoMa

ChenWuJie 4 years ago
parent
commit
dcacbdf429

+ 112 - 0
app/Admin/Actions/Vaccines/ImportAction.php

xqd
@@ -0,0 +1,112 @@
+<?php
+
+namespace App\Admin\Actions\Vaccines;
+
+use Encore\Admin\Actions\Action;
+use Illuminate\Http\Request;
+use App\Imports\Vaccines\ImportMember;
+use Encore\Admin\Admin;
+use Maatwebsite\Excel\Facades\Excel;
+
+class ImportAction extends Action
+{
+    protected $selector = '.import-action';
+
+    public function handle(Request $request)
+    {
+        try{
+            // $request ...
+            $file = $request-> file('file');
+
+            Excel::import(new ImportMember(),$file);
+
+            return $this->response()->success('数据导入成功')->refresh();
+        }catch (\Exception $e){
+            return $this->response()->error($e -> getMessage());
+        }
+    }
+
+    public function html()
+    {
+        return <<<HTML
+        <a class="btn btn-sm btn-default import-action">导入</a>
+HTML;
+    }
+
+
+    //表单
+    public function form()
+    {
+        $this
+            ->file('file', '请选择文件')
+            ->options(['showPreview' => false,
+                'allowedFileExtensions'=>['xlsx','xls','csv'],
+                'showUpload'=>true
+            ]);
+    }
+
+    //上传等待
+    public function handleActionPromise()
+    {
+        $resolve = <<<SCRIPT
+var actionResolverss = function (data) {
+            $('.modal-footer').show()
+            $('.tips').remove()
+            var response = data[0];
+            var target   = data[1];
+
+            if (typeof response !== 'object') {
+                return $.admin.swal({type: 'error', title: 'Oops!'});
+            }
+
+            var then = function (then) {
+                if (then.action == 'refresh') {
+                    $.admin.reload();
+                }
+
+                if (then.action == 'download') {
+                    window.open(then.value, '_blank');
+                }
+
+                if (then.action == 'redirect') {
+                    $.admin.redirect(then.value);
+                }
+            };
+
+            if (typeof response.html === 'string') {
+                target.html(response.html);
+            }
+
+            if (typeof response.swal === 'object') {
+                $.admin.swal(response.swal);
+            }
+
+            if (typeof response.toastr === 'object') {
+                $.admin.toastr[response.toastr.type](response.toastr.content, '', response.toastr.options);
+            }
+
+            if (response.then) {
+              then(response.then);
+            }
+        };
+
+        var actionCatcherss = function (request) {
+            $('.modal-footer').show()
+            $('.tips').remove()
+
+            if (request && typeof request.responseJSON === 'object') {
+                $.admin.toastr.error(request.responseJSON.message, '', {positionClass:"toast-bottom-center", timeOut: 10000}).css("width","500px")
+            }
+        };
+SCRIPT;
+
+        Admin::script($resolve);
+
+        return <<<SCRIPT
+         $('.modal-footer').hide()
+         let html = `<div class='tips' style='color: #ff3249;font-size: 18px;'>导入时间取决于数据量,请耐心等待结果不要关闭窗口!<img src="data:image/gif;base64,R0lGODlhEAAQAPQAAP///1VVVfr6+np6eqysrFhYWG5ubuPj48TExGNjY6Ojo5iYmOzs7Lq6utjY2ISEhI6OjgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFUCAgjmRpnqUwFGwhKoRgqq2YFMaRGjWA8AbZiIBbjQQ8AmmFUJEQhQGJhaKOrCksgEla+KIkYvC6SJKQOISoNSYdeIk1ayA8ExTyeR3F749CACH5BAkKAAAALAAAAAAQABAAAAVoICCKR9KMaCoaxeCoqEAkRX3AwMHWxQIIjJSAZWgUEgzBwCBAEQpMwIDwY1FHgwJCtOW2UDWYIDyqNVVkUbYr6CK+o2eUMKgWrqKhj0FrEM8jQQALPFA3MAc8CQSAMA5ZBjgqDQmHIyEAIfkECQoAAAAsAAAAABAAEAAABWAgII4j85Ao2hRIKgrEUBQJLaSHMe8zgQo6Q8sxS7RIhILhBkgumCTZsXkACBC+0cwF2GoLLoFXREDcDlkAojBICRaFLDCOQtQKjmsQSubtDFU/NXcDBHwkaw1cKQ8MiyEAIfkECQoAAAAsAAAAABAAEAAABVIgII5kaZ6AIJQCMRTFQKiDQx4GrBfGa4uCnAEhQuRgPwCBtwK+kCNFgjh6QlFYgGO7baJ2CxIioSDpwqNggWCGDVVGphly3BkOpXDrKfNm/4AhACH5BAkKAAAALAAAAAAQABAAAAVgICCOZGmeqEAMRTEQwskYbV0Yx7kYSIzQhtgoBxCKBDQCIOcoLBimRiFhSABYU5gIgW01pLUBYkRItAYAqrlhYiwKjiWAcDMWY8QjsCf4DewiBzQ2N1AmKlgvgCiMjSQhACH5BAkKAAAALAAAAAAQABAAAAVfICCOZGmeqEgUxUAIpkA0AMKyxkEiSZEIsJqhYAg+boUFSTAkiBiNHks3sg1ILAfBiS10gyqCg0UaFBCkwy3RYKiIYMAC+RAxiQgYsJdAjw5DN2gILzEEZgVcKYuMJiEAOwAAAAAAAAAAAA=="><\/div>`
+         $('.modal-header').append(html)
+process.then(actionResolverss).catch(actionCatcherss);
+SCRIPT;
+    }
+}

+ 13 - 2
app/Admin/Controllers/ArticleController.php

xqd xqd
@@ -27,12 +27,23 @@ class ArticleController extends AdminController
         $grid = new Grid(new Article());
 
         $grid->column('id', __('Id'));
-        $grid->column('type', __('分类'));
+        $grid->column('type', __('分类'))->using([1=>'没',2=>'有',3=>'分',4=>'类']);
         $grid->column('title', __('标题'))->limit(10,'...')->width(100);
         $grid->column('content', __('内容'))->limit(20,'...')->width(200);
         $grid->column('banner_url', __('图片'))->image('',50,50);
         $grid->column('created_at', __('创建时间'));
         $grid->column('updated_at', __('更新时间'));
+        $grid->filter(function($filter){
+
+            // Remove the default id filter
+            $filter->disableIdFilter();
+
+            // Add a column filter
+            $type = [''=>'全部'];
+            $type = array_merge($type,Article::$_post_type);
+            $filter->equal('type', '类别')->select(Article::$_post_type);
+
+        });
 
         return $grid;
     }
@@ -67,7 +78,7 @@ class ArticleController extends AdminController
     {
         $form = new Form(new Article());
 
-        $form->select('type', __('分类'))->options(Article::$_post_type)->default(1);
+        $form->select('type', __('分类'))->options(Article::$_post_type)->default('1');
         $form->text('title', __('标题'))->rules('required|min:3|max:255',['required'=>'请填写标题','min'=>'标题字符不能少于3个','max'=>'标题长度过长']);
         $form->textarea('content', __('内容'))->rules('required|min:3',['required'=>'请填写标题','min'=>'标题字符不能少于3个']);
         $form->image('banner_url', __('图片'))->rules('required' ,['required'=>'请选择图片!']);

+ 130 - 0
app/Admin/Controllers/VaccinesController.php

xqd
@@ -0,0 +1,130 @@
+<?php
+
+namespace App\Admin\Controllers;
+
+use App\Models\Vaccines;
+use App\Admin\Actions\Vaccines\ImportAction;
+use Encore\Admin\Controllers\AdminController;
+use Encore\Admin\Form;
+use Encore\Admin\Grid;
+use Encore\Admin\Show;
+
+class VaccinesController extends AdminController
+{
+    /**
+     * Title for current resource.
+     *
+     * @var string
+     */
+    protected $title = 'Vaccines';
+
+    /**
+     * Make a grid builder.
+     *
+     * @return Grid
+     */
+    protected function grid()
+    {
+        $grid = new Grid(new Vaccines());
+
+        $grid->column('id', __('Id'));
+        $grid->column('type', '类型')->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
+        $grid->column('name', __('名称'));
+        $grid->column('introduction','简介');
+        $grid->column('price', __('价钱'));
+        $grid->column('remark', __('备注'));
+        $grid->column('supplier', __('厂家'));
+        $states = [
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+        ];
+        $grid->column('states','状态')->switch($states);
+        $grid->column('created_at', __('创建时间'));
+        $grid->column('updated_at', __('更新时间'));
+
+        $grid->filter(function($filter){
+            /*
+                搜索:按关键字、ID搜索
+                筛选:类别筛选
+                导入、导出
+            */
+            // 在这里添加字段过滤器
+            $filter->column(1/2, function ($filter) {
+                $filter->equal('type', '类型')->select(Vaccines::$_post_type);
+            });
+
+        });
+
+        //按关键字查询
+        $grid->quickSearch(function ($model, $query) {
+            //$model->whereHas('Vaccines',function ($model) use ($query) {
+                $model->where('type', 'like', "%{$query}%")
+                    ->orWhere('name', 'like', "%{$query}%")
+                    ->orWhere('id',$query)
+                    ->orwhere('supplier','like',"%{$query}%")
+                    ->orwhere('remark','like',"{$query}");
+            //});
+        })->placeholder('请输入疫苗id/名称/厂家/备注');
+
+        $grid->export(function ($export) {
+            //文件名
+            $export->filename('测试');
+            //排除字段不用导出
+            $export->except(['created_at', 'updated_at']);
+            $export->originalValue(['states']);
+        });
+
+        $grid->tools(function (Grid\Tools $tools) {
+            $tools->append(new ImportAction());
+        });
+
+        return $grid;
+    }
+
+    /**
+     * Make a show builder.
+     *
+     * @param mixed $id
+     * @return Show
+     */
+    protected function detail($id)
+    {
+        $show = new Show(Vaccines::findOrFail($id));
+
+        $show->field('id', __('Id'));
+        $show->field('type', __('分类'))->using([1=>'Ⅰ类疫苗',2=>'Ⅱ类疫苗']);
+        $show->field('introduction','简介');
+        $show->field('price', __('价钱'));
+        $show->field('name', __('名称'));
+        $show->field('remark', __('备注'));
+        $show->field('supplier', __('厂家'));
+        $show->field('created_at', __('创建时间'));
+        $show->field('updated_at', __('更新时间'));
+
+        return $show;
+    }
+
+    /**
+     * Make a form builder.
+     *
+     * @return Form
+     */
+    protected function form()
+    {
+        $form = new Form(new Vaccines());
+
+        $form->select('type', __('分类'))->options(Vaccines::$_post_type)->default('1');
+        $form->text('name', __('名称'))->rules('required|min:3|max:255',['required'=>'请填写名称','min'=>'名称不能少于3个字符!','max'=>'名称长度过长!']);
+        $form->text('introduction','简介')->rules('required',['require'=>'请填写疫苗简介!' ]);
+        $form->currency('price', __('价格'))->symbol('分');
+        $form->text('remark', __('备注'))->rules('required',['required'=>'请填写备注!']);;
+        $form->text('supplier', __('厂家'))->rules('required',['required'=>'请填写厂家!']);
+        $states = [
+            'off' => ['value' => 0, 'text' => '禁用', 'color' => 'danger'],
+            'on'  => ['value' => 1, 'text' => '启用', 'color' => 'success'],
+        ];
+        $form->switch('states','状态')->states($states);
+
+        return $form;
+    }
+}

+ 2 - 0
app/Admin/routes.php

xqd
@@ -21,6 +21,8 @@ Route::group([
     $router->resource('banners', BannerController::class);
     $router->resource('servebanners', ServebannerController::class);
     $router->resource('articles', ArticleController::class);
+
+    $router->resource('vaccines', VaccinesController::class);
     $router->resource('docters_management', DoctorManagementController::class);
     $router->resource('users', UserListController::class);
     $router->resource('user_patients', UserPatientsController::class);

+ 34 - 0
app/Imports/Vaccines/ImportMember.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+namespace App\Imports\Vaccines;
+
+use App\Models\Vaccines;
+use Maatwebsite\Excel\Concerns\ToModel;
+use Maatwebsite\Excel\Concerns\WithStartRow;
+use Maatwebsite\Excel\Facades\Excel;
+
+class ImportMember implements ToModel
+{
+    /**
+    * @param array $row
+    *
+    * @return \Illuminate\Database\Eloquent\Model|null
+    */
+    public function model(array $row)
+    {
+        return new Vaccines([
+            //
+            'type' => $row[1],
+            'name' => $row[2],
+            'introduction' => $row[3],
+            'price' => $row[4],
+            'remark' => $row[5],
+            'supplier' => $row[6],
+            'states' => $row[7]
+        ]);
+    }
+    public function startRow(): int
+    {
+        return 2;
+    }
+}

+ 17 - 0
app/Models/Vaccines.php

xqd
@@ -0,0 +1,17 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Vaccines extends Model
+{
+    //
+    protected $table = 'vaccines';
+    public static $_post_type = [
+        1=>"Ⅰ类疫苗",
+        2=>"Ⅱ类疫苗"
+    ];
+
+    protected $fillable = ['type','price',"name","remark","supplier",'states'];
+}

+ 1 - 0
composer.json

xqd
@@ -14,6 +14,7 @@
         "laravel-admin-ext/multitenancy": "^2.1",
         "laravel/framework": "^6.0",
         "laravel/tinker": "^1.0",
+        "maatwebsite/excel": "^3.1",
         "overtrue/wechat": "^4.0"
     },
     "require-dev": {

+ 582 - 2
composer.lock

xqd xqd xqd xqd xqd xqd
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "6f09d3514cf131189db240b04e0ab14b",
+    "content-hash": "ba59c15c3b2309c40638946694b9bf00",
     "packages": [
         {
             "name": "dnoegel/php-xdg-base-dir",
@@ -1581,6 +1581,352 @@
             "description": "Mime-type detection for Flysystem",
             "time": "2020-09-21T18:10:53+00:00"
         },
+        {
+            "name": "maatwebsite/excel",
+            "version": "3.1.25",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/Maatwebsite/Laravel-Excel.git",
+                "reference": "a3e56f1a60e49f21798fd242a3b3d2f4051eeda7"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/Maatwebsite/Laravel-Excel/zipball/a3e56f1a60e49f21798fd242a3b3d2f4051eeda7",
+                "reference": "a3e56f1a60e49f21798fd242a3b3d2f4051eeda7",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "ext-json": "*",
+                "illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0",
+                "php": "^7.0",
+                "phpoffice/phpspreadsheet": "^1.14"
+            },
+            "require-dev": {
+                "orchestra/testbench": "^6.0",
+                "predis/predis": "^1.1"
+            },
+            "type": "library",
+            "extra": {
+                "laravel": {
+                    "providers": [
+                        "Maatwebsite\\Excel\\ExcelServiceProvider"
+                    ],
+                    "aliases": {
+                        "Excel": "Maatwebsite\\Excel\\Facades\\Excel"
+                    }
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Maatwebsite\\Excel\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Patrick Brouwers",
+                    "email": "patrick@maatwebsite.nl"
+                }
+            ],
+            "description": "Supercharged Excel exports and imports in Laravel",
+            "keywords": [
+                "PHPExcel",
+                "batch",
+                "csv",
+                "excel",
+                "export",
+                "import",
+                "laravel",
+                "php",
+                "phpspreadsheet"
+            ],
+            "support": {
+                "issues": "https://github.com/Maatwebsite/Laravel-Excel/issues",
+                "source": "https://github.com/Maatwebsite/Laravel-Excel/tree/3.1.25"
+            },
+            "funding": [
+                {
+                    "url": "https://laravel-excel.com/commercial-support",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/patrickbrouwers",
+                    "type": "github"
+                }
+            ],
+            "time": "2020-11-13T10:37:36+00:00"
+        },
+        {
+            "name": "maennchen/zipstream-php",
+            "version": "2.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/maennchen/ZipStream-PHP.git",
+                "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/c4c5803cc1f93df3d2448478ef79394a5981cc58",
+                "reference": "c4c5803cc1f93df3d2448478ef79394a5981cc58",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "myclabs/php-enum": "^1.5",
+                "php": ">= 7.1",
+                "psr/http-message": "^1.0",
+                "symfony/polyfill-mbstring": "^1.0"
+            },
+            "require-dev": {
+                "ext-zip": "*",
+                "guzzlehttp/guzzle": ">= 6.3",
+                "mikey179/vfsstream": "^1.6",
+                "phpunit/phpunit": ">= 7.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "ZipStream\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Paul Duncan",
+                    "email": "pabs@pablotron.org"
+                },
+                {
+                    "name": "Jonatan Männchen",
+                    "email": "jonatan@maennchen.ch"
+                },
+                {
+                    "name": "Jesse Donat",
+                    "email": "donatj@gmail.com"
+                },
+                {
+                    "name": "András Kolesár",
+                    "email": "kolesar@kolesar.hu"
+                }
+            ],
+            "description": "ZipStream is a library for dynamically streaming dynamic zip files from PHP without writing to the disk at all on the server.",
+            "keywords": [
+                "stream",
+                "zip"
+            ],
+            "support": {
+                "issues": "https://github.com/maennchen/ZipStream-PHP/issues",
+                "source": "https://github.com/maennchen/ZipStream-PHP/tree/master"
+            },
+            "funding": [
+                {
+                    "url": "https://opencollective.com/zipstream",
+                    "type": "open_collective"
+                }
+            ],
+            "time": "2020-05-30T13:11:16+00:00"
+        },
+        {
+            "name": "markbaker/complex",
+            "version": "2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/MarkBaker/PHPComplex.git",
+                "reference": "9999f1432fae467bc93c53f357105b4c31bb994c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/9999f1432fae467bc93c53f357105b4c31bb994c",
+                "reference": "9999f1432fae467bc93c53f357105b4c31bb994c",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
+                "phpcompatibility/php-compatibility": "^9.0",
+                "phpdocumentor/phpdocumentor": "2.*",
+                "phploc/phploc": "^4.0",
+                "phpmd/phpmd": "2.*",
+                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
+                "sebastian/phpcpd": "^4.0",
+                "squizlabs/php_codesniffer": "^3.4"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Complex\\": "classes/src/"
+                },
+                "files": [
+                    "classes/src/functions/abs.php",
+                    "classes/src/functions/acos.php",
+                    "classes/src/functions/acosh.php",
+                    "classes/src/functions/acot.php",
+                    "classes/src/functions/acoth.php",
+                    "classes/src/functions/acsc.php",
+                    "classes/src/functions/acsch.php",
+                    "classes/src/functions/argument.php",
+                    "classes/src/functions/asec.php",
+                    "classes/src/functions/asech.php",
+                    "classes/src/functions/asin.php",
+                    "classes/src/functions/asinh.php",
+                    "classes/src/functions/atan.php",
+                    "classes/src/functions/atanh.php",
+                    "classes/src/functions/conjugate.php",
+                    "classes/src/functions/cos.php",
+                    "classes/src/functions/cosh.php",
+                    "classes/src/functions/cot.php",
+                    "classes/src/functions/coth.php",
+                    "classes/src/functions/csc.php",
+                    "classes/src/functions/csch.php",
+                    "classes/src/functions/exp.php",
+                    "classes/src/functions/inverse.php",
+                    "classes/src/functions/ln.php",
+                    "classes/src/functions/log2.php",
+                    "classes/src/functions/log10.php",
+                    "classes/src/functions/negative.php",
+                    "classes/src/functions/pow.php",
+                    "classes/src/functions/rho.php",
+                    "classes/src/functions/sec.php",
+                    "classes/src/functions/sech.php",
+                    "classes/src/functions/sin.php",
+                    "classes/src/functions/sinh.php",
+                    "classes/src/functions/sqrt.php",
+                    "classes/src/functions/tan.php",
+                    "classes/src/functions/tanh.php",
+                    "classes/src/functions/theta.php",
+                    "classes/src/operations/add.php",
+                    "classes/src/operations/subtract.php",
+                    "classes/src/operations/multiply.php",
+                    "classes/src/operations/divideby.php",
+                    "classes/src/operations/divideinto.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mark Baker",
+                    "email": "mark@lange.demon.co.uk"
+                }
+            ],
+            "description": "PHP Class for working with complex numbers",
+            "homepage": "https://github.com/MarkBaker/PHPComplex",
+            "keywords": [
+                "complex",
+                "mathematics"
+            ],
+            "support": {
+                "issues": "https://github.com/MarkBaker/PHPComplex/issues",
+                "source": "https://github.com/MarkBaker/PHPComplex/tree/PHP8"
+            },
+            "time": "2020-08-26T10:42:07+00:00"
+        },
+        {
+            "name": "markbaker/matrix",
+            "version": "2.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/MarkBaker/PHPMatrix.git",
+                "reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
+                "reference": "9567d9c4c519fbe40de01dbd1e4469dbbb66f46a",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": "^7.2 || ^8.0"
+            },
+            "require-dev": {
+                "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
+                "phpcompatibility/php-compatibility": "^9.0",
+                "phpdocumentor/phpdocumentor": "2.*",
+                "phploc/phploc": "^4.0",
+                "phpmd/phpmd": "2.*",
+                "phpunit/phpunit": "^7.0 || ^8.0 || ^9.3",
+                "sebastian/phpcpd": "^4.0",
+                "squizlabs/php_codesniffer": "^3.4"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Matrix\\": "classes/src/"
+                },
+                "files": [
+                    "classes/src/functions/adjoint.php",
+                    "classes/src/functions/antidiagonal.php",
+                    "classes/src/functions/cofactors.php",
+                    "classes/src/functions/determinant.php",
+                    "classes/src/functions/diagonal.php",
+                    "classes/src/functions/identity.php",
+                    "classes/src/functions/inverse.php",
+                    "classes/src/functions/minors.php",
+                    "classes/src/functions/trace.php",
+                    "classes/src/functions/transpose.php",
+                    "classes/src/operations/add.php",
+                    "classes/src/operations/directsum.php",
+                    "classes/src/operations/subtract.php",
+                    "classes/src/operations/multiply.php",
+                    "classes/src/operations/divideby.php",
+                    "classes/src/operations/divideinto.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Mark Baker",
+                    "email": "mark@demon-angel.eu"
+                }
+            ],
+            "description": "PHP Class for working with matrices",
+            "homepage": "https://github.com/MarkBaker/PHPMatrix",
+            "keywords": [
+                "mathematics",
+                "matrix",
+                "vector"
+            ],
+            "support": {
+                "issues": "https://github.com/MarkBaker/PHPMatrix/issues",
+                "source": "https://github.com/MarkBaker/PHPMatrix/tree/PHP8"
+            },
+            "time": "2020-08-28T17:11:00+00:00"
+        },
         {
             "name": "monolog/monolog",
             "version": "2.1.1",
@@ -1668,6 +2014,72 @@
             ],
             "time": "2020-07-23T08:41:23+00:00"
         },
+        {
+            "name": "myclabs/php-enum",
+            "version": "1.7.7",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/myclabs/php-enum.git",
+                "reference": "d178027d1e679832db9f38248fcc7200647dc2b7"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/myclabs/php-enum/zipball/d178027d1e679832db9f38248fcc7200647dc2b7",
+                "reference": "d178027d1e679832db9f38248fcc7200647dc2b7",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "ext-json": "*",
+                "php": ">=7.1"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^7",
+                "squizlabs/php_codesniffer": "1.*",
+                "vimeo/psalm": "^3.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "MyCLabs\\Enum\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP Enum contributors",
+                    "homepage": "https://github.com/myclabs/php-enum/graphs/contributors"
+                }
+            ],
+            "description": "PHP Enum implementation",
+            "homepage": "http://github.com/myclabs/php-enum",
+            "keywords": [
+                "enum"
+            ],
+            "support": {
+                "issues": "https://github.com/myclabs/php-enum/issues",
+                "source": "https://github.com/myclabs/php-enum/tree/1.7.7"
+            },
+            "funding": [
+                {
+                    "url": "https://github.com/mnapoli",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/myclabs/php-enum",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-14T18:14:52+00:00"
+        },
         {
             "name": "nesbot/carbon",
             "version": "2.40.0",
@@ -2062,6 +2474,112 @@
             ],
             "time": "2018-07-02T15:55:56+00:00"
         },
+        {
+            "name": "phpoffice/phpspreadsheet",
+            "version": "1.15.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+                "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
+                "reference": "a8e8068b31b8119e1daa5b1eb5715a3a8ea8305f",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "ext-ctype": "*",
+                "ext-dom": "*",
+                "ext-fileinfo": "*",
+                "ext-gd": "*",
+                "ext-iconv": "*",
+                "ext-libxml": "*",
+                "ext-mbstring": "*",
+                "ext-simplexml": "*",
+                "ext-xml": "*",
+                "ext-xmlreader": "*",
+                "ext-xmlwriter": "*",
+                "ext-zip": "*",
+                "ext-zlib": "*",
+                "maennchen/zipstream-php": "^2.1",
+                "markbaker/complex": "^1.5|^2.0",
+                "markbaker/matrix": "^1.2|^2.0",
+                "php": "^7.2|^8.0",
+                "psr/http-client": "^1.0",
+                "psr/http-factory": "^1.0",
+                "psr/simple-cache": "^1.0"
+            },
+            "require-dev": {
+                "dompdf/dompdf": "^0.8.5",
+                "friendsofphp/php-cs-fixer": "^2.16",
+                "jpgraph/jpgraph": "^4.0",
+                "mpdf/mpdf": "^8.0",
+                "phpcompatibility/php-compatibility": "^9.3",
+                "phpunit/phpunit": "^8.5|^9.3",
+                "squizlabs/php_codesniffer": "^3.5",
+                "tecnickcom/tcpdf": "^6.3"
+            },
+            "suggest": {
+                "dompdf/dompdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)",
+                "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+                "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+                "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer (doesn't yet support PHP8)"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Maarten Balliauw",
+                    "homepage": "https://blog.maartenballiauw.be"
+                },
+                {
+                    "name": "Mark Baker",
+                    "homepage": "https://markbakeruk.net"
+                },
+                {
+                    "name": "Franck Lefevre",
+                    "homepage": "https://rootslabs.net"
+                },
+                {
+                    "name": "Erik Tilt"
+                },
+                {
+                    "name": "Adrien Crivelli"
+                }
+            ],
+            "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+            "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+            "keywords": [
+                "OpenXML",
+                "excel",
+                "gnumeric",
+                "ods",
+                "php",
+                "spreadsheet",
+                "xls",
+                "xlsx"
+            ],
+            "support": {
+                "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
+                "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/1.15.0"
+            },
+            "time": "2020-10-11T13:20:59+00:00"
+        },
         {
             "name": "phpoption/phpoption",
             "version": "1.7.5",
@@ -2341,6 +2859,67 @@
             ],
             "time": "2020-06-29T06:28:15+00:00"
         },
+        {
+            "name": "psr/http-factory",
+            "version": "1.0.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/http-factory.git",
+                "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+                "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
+                "shasum": "",
+                "mirrors": [
+                    {
+                        "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
+                        "preferred": true
+                    }
+                ]
+            },
+            "require": {
+                "php": ">=7.0.0",
+                "psr/http-message": "^1.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Http\\Message\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interfaces for PSR-7 HTTP message factories",
+            "keywords": [
+                "factory",
+                "http",
+                "message",
+                "psr",
+                "psr-17",
+                "psr-7",
+                "request",
+                "response"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/http-factory/tree/master"
+            },
+            "time": "2019-04-30T12:38:16+00:00"
+        },
         {
             "name": "psr/http-message",
             "version": "1.0.1",
@@ -6986,5 +7565,6 @@
     "platform": {
         "php": "^7.2"
     },
-    "platform-dev": []
+    "platform-dev": [],
+    "plugin-api-version": "2.0.0"
 }

+ 36 - 0
database/migrations/2020_11_25_095040_add_field.php

xqd
@@ -0,0 +1,36 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class AddField extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        //
+        Schema::table('vaccines', function (Blueprint $table) {
+            $table->unsignedTinyInteger('states')->after('supplier');
+            $table->string('introduction')->after('name');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        //
+        Schema::table('vaccines', function (Blueprint $table) {
+            $table->dropColumn('states');
+            $table->dropColumn('introduction');
+        });
+    }
+}