bucket.'/'.$this->name; $data = [ "id" => $this->id, "user_uid" => $this->user_uid, "name" => $filename, "filename" => $filename, "title" => $this->title, "size" => $this->size, "content_type" => $this->content_type, "status" => $this->status, "created_at" => $this->created_at, "updated_at" => $this->updated_at, ]; if (App::environment('local')) { $data['url'] = Storage::url($filename); }else{ $data['url'] = Storage::temporaryUrl($filename, now()->addDays(6)); } return $data; } }