Level 24
@samehdev when you create a blank model, make sure the array $path key name is in model $fillable
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
laravel : 9
inertiajs and vue 3
Route::get('identityImage/{file}', [IdentityController::class, 'getImage'])
public function getImage(Request $request, $id)
{
$media = Media::find($id);
$path = $media->getPath('md'); // /home/myuser/mydemo.com/storage/app/protuct/5/conversions/test-md.webp
return Image::make($path)->response();
}
response
HTTP/1.1 200 OK
Date: Mon, 05 Dec 2022 22:46:01 GMT
Server: Apache/2.4.47 (Win64) OpenSSL/1.1.1q PHP/8.1.9
Cache-Control: no-cache, private
Content-Length: 37840
Vary: X-Inertia
Alt-Svc: h3=":443"; ma=86400
Referrer-Policy: no-referrer-when-downgrade
X-XSS-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Expect-CT: enforce, max-age=30
Permissions-Policy: autoplay=(self), camera=(), encrypted-media=(self), fullscreen=(), geolocation=(self), gyroscope=(self), magnetometer=(), microphone=(), midi=(), payment=(), sync-xhr=(self), usb=()
X-Frame-Options: DENY
Access-Control-Allow-Methods: GET,POST,PUT,DELETE
Access-Control-Allow-Headers: Content-Type,Authorization,X-Requested-With,X-CSRF-Token,x-api-key
Set-Cookie: XSRF-TOKEN=......; secure; samesite=lax
Set-Cookie: laravel_session=......; secure; httponly; samesite=lax
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: image/webp
and image not working
Please or to participate in this conversation.