Flare Laravel Error Tracking
Get all these insights and more when you sign up for FlareLearn more
This is a public shared error.
ErrorException
PHP 8.3.1711.44.0
Attempt to read property "filename" on null
: $this->defaultImage();
}
public function getPreviewUrlAttribute(): string
{
return $this->files
? Storage::url('public/files/large/'.$this->files()->first()->filename.'.webp')
: $this->defaultImage();
}
public function getImageUrlAttribute(): string
{
\Log::debug($this->files);
return $this->files
? Storage::url('public/files/show/'.$this->files()->first()->filename.'.webp')
: $this->defaultImage();
}
public function getImageContactAttribute(): string
{
return $this->files
? Storage::url('public/files/contact/'.$this->files()->first()->filename.'.webp')
: $this->defaultImage();
}
protected function defaultImage(): string
{
return Storage::disk('public')->url('default.webp');
}

App

Routing

Action
App\Http\Controllers\GalleryController@show
Route name
gallery.show
Route parameters
folder
final-fantasy-xiv
image
{
    "id": 317,
    "shortkey": "cA90W",
    "description": "Langsam wird es Herbstlich überall, Zeit also mal sich in die entsprechende Stimmung zu bringen! Vor allem, wenn man von einer guten Freundin ein solch tolles Oberteil geschenkt bekommt.",
    "status": 1,
    "watermark": 1,
    "promoted": 0,
    "user_id": 1,
    "folder_id": 1,
    "created_at": "2022-09-18T20:31:45.000000Z",
    "updated_at": "2024-08-04T10:50:55.000000Z",
    "deleted_at": null,
    "likes_count": 0,
    "fileCount": 5,
    "image_url": "/storage/files/show/RjiXUVJvciYlYSJ46LZqUrO1fzzQGAHvyTbIVfuhHffZSTZ0amZd4rWZiHvdpJsJ.webp",
    "folder_url": "/storage/files/folder/RjiXUVJvciYlYSJ46LZqUrO1fzzQGAHvyTbIVfuhHffZSTZ0amZd4rWZiHvdpJsJ.webp",
    "image_contact": "/storage/files/contact/RjiXUVJvciYlYSJ46LZqUrO1fzzQGAHvyTbIVfuhHffZSTZ0amZd4rWZiHvdpJsJ.webp",
    "files": [
        {
            "id": 332,
            "filename": "RjiXUVJvciYlYSJ46LZqUrO1fzzQGAHvyTbIVfuhHffZSTZ0amZd4rWZiHvdpJsJ",
            "extension": "webp",
            "mime": "image/webp",
            "filesize": 251218,
            "width": 2560,
            "height": 1440,
            "user_id": 1,
            "image_id": 317,
            "created_at": "2022-09-18T20:31:47.000000Z",
            "updated_at": "2024-08-04T10:50:57.000000Z",
            "deleted_at": null
        },
        {
            "id": 333,
            "filename": "8zY4MyEbVHfhdjp1DE7JT2TAsZ8Jn2hdFbdrmu0sc4lTfIkHwwPlF5HugdA0msBt",
            "extension": "webp",
            "mime": "image/webp",
            "filesize": 251218,
            "width": 2560,
            "height": 1440,
            "user_id": 1,
            "image_id": 317,
            "created_at": "2022-09-18T20:31:48.000000Z",
            "updated_at": "2024-08-04T10:50:59.000000Z",
            "deleted_at": null
        },
        {
            "id": 334,
            "filename": "5gkfI3vvofe5gdICNvSjAo27ioELuYLcyn9WiyDJbs5MzvuVFNdqt5ZqKws7jznk",
            "extension": "webp",
            "mime": "image/webp",
            "filesize": 251218,
            "width": 2560,
            "height": 1440,
            "user_id": 1,
            "image_id": 317,
            "created_at": "2022-09-18T20:31:50.000000Z",
            "updated_at": "2024-08-04T10:51:01.000000Z",
            "deleted_at": null
        },
        {
            "id": 335,
            "filename": "Mq6ZPB0YrrqoaxzOyasflVDS3RkE0wRV3YMGRIMOdtfmHVDe0a8dHm9VTnQ6qmZg",
            "extension": "webp",
            "mime": "image/webp",
            "filesize": 251218,
            "width": 2560,
            "height": 1440,
            "user_id": 1,
            "image_id": 317,
            "created_at": "2022-09-18T20:31:51.000000Z",
            "updated_at": "2024-08-04T10:51:04.000000Z",
            "deleted_at": null
        },
        {
            "id": 336,
            "filename": "Zku2g49M0sj4310D77pVFtQnjWDyklxbmZ8klgxwLw8Vgz41ymH3WQBcEuMktL6Q",
            "extension": "webp",
            "mime": "image/webp",
            "filesize": 251218,
            "width": 2560,
            "height": 1440,
            "user_id": 1,
            "image_id": 317,
            "created_at": "2022-09-18T20:31:53.000000Z",
            "updated_at": "2024-08-04T10:51:06.000000Z",
            "deleted_at": null
        }
    ]
}
Middleware
  • web

Request

Context

Versions

App Version
f91898d
laravel version
11.44.0
Laravel locale
de
Laravel config cached
true
Laravel debug
false