¨4.0.1¨

This commit is contained in:
¨NW¨
2023-12-03 14:07:47 +00:00
parent c08b36d1b6
commit f35052522d
1112 changed files with 43019 additions and 24987 deletions

View File

@@ -2,6 +2,7 @@
namespace Modules\Account\Http\Controllers;
use Illuminate\Http\Response;
use Modules\Order\Entities\Order;
class AccountDownloadsController
@@ -9,7 +10,7 @@ class AccountDownloadsController
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
* @return Response
*/
public function index()
{
@@ -18,23 +19,26 @@ class AccountDownloadsController
]);
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*
* @return Response
*/
public function show($id)
{
$file = $this->getDownloads()->firstWhere('id', decrypt($id));
if (is_null($file) || ! file_exists($file->realPath())) {
if (is_null($file) || !file_exists($file->realPath())) {
return back()->with('error', trans('storefront::account.downloads.no_file_found'));
}
return response()->download($file->realPath(), $file->filename);
}
private function getDownloads()
{
return auth()->user()