From 8fb81fdf576e19d31d3e1662947ac1c9616ee975 Mon Sep 17 00:00:00 2001 From: OhmygoodR <109280933+OhmygoodR@users.noreply.github.com> Date: Wed, 14 Feb 2024 22:07:33 +0800 Subject: [PATCH] Update CompanyController.php --- app/Http/Controllers/CompanyController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index debf715a..5fca2c0b 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -20,7 +20,7 @@ public function store(Request $request) public function show(Company $company) { // TASK: retrieve the full URL to the uploaded photo file, using Spatie Media Library - $photo = $company[0]->getFullUrl(); + $photo = $company->getMedia('photo')[0]->getFullUrl(); return view('companies.show', compact('company', 'photo')); }