简体   繁体   English

Laravel 5.8:如何上载,下载和删除链接到员工的文档(一对多关系)

[英]Laravel 5.8: How to upload, download, and delete documents thats link to an employee (1-to-many relationship)

I'm new to Laravel and i'm trying to create a HR system to store employee information. 我是Laravel的新手,我正在尝试创建一个用于存储员工信息的HR系统。 My question is how to create a function that can upload, download, delete documents(pdf, excel, jpg files etc) belongs to specific employee? 我的问题是如何创建可以上载,下载,删除属于特定员工的文档(pdf,excel,jpg文件等)的功能?

I have searched all over the internet but i cant found any complete tutorial about this. 我已经在互联网上进行了搜索,但是找不到关于此的完整教程。 Most of the content only teach how to either upload or download, but not the whole set of it. 大多数内容仅讲授如何上传或下载,但不讲授全部内容。

I found an example from internet and my desired outcomes are as below: 我从互联网上找到了一个例子,我的期望结果如下:

Desired outcome 期望的结果

Greatly appreciate if someone can help me with this from scratch or any tutorial for this? 非常感谢有人可以从头开始为我提供帮助,或者为此提供任何教程? Many thanks in advance! 提前谢谢了!

Consider using a library such as laravel-paperclip to allow you to attach files to models, using a trait. 考虑使用诸如laravel-paperclip之类的库,以允许您使用特征将文件附加到模型。

You could also build your own custom system, but that's beyond the scope of a SO answer. 您也可以构建自己的自定义系统,但这超出了SO答案的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM