'datetime', ]; protected $fillable = [ 'device_id', 'url', 'uploaded_at', ]; public function imageUrl(): Attribute { return Attribute::make( get: function(mixed $value, array $attributes) { if (preg_match('/^https?:\/\//', $attributes['url']) > 0) { return $attributes['url']; } return Storage::disk('public')->url($attributes['url']); }, ); } }