Attachment controller basic index.

This commit is contained in:
James Cole
2018-04-28 06:34:01 +02:00
parent 13b78bdc20
commit cabe90b2dd
4 changed files with 91 additions and 0 deletions

View File

@@ -147,6 +147,24 @@ class AttachmentController extends Controller
return view('attachments.edit', compact('attachment', 'subTitleIcon', 'subTitle'));
}
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index()
{
$set = $this->repository->get();
$set = $set->each(
function (Attachment $attachment) {
$attachment->file_exists = $this->repository->exists($attachment);
return $attachment;
}
);
return view('attachments.index', compact('set'));
}
/**
* @param AttachmentFormRequest $request
* @param Attachment $attachment