PHPackages                             lucaf87/flysystem-pcloud - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. lucaf87/flysystem-pcloud

ActiveProject[File &amp; Storage](/categories/file-storage)

lucaf87/flysystem-pcloud
========================

1.0.8(1y ago)81.1k↓50%MITPHPPHP ^8.1

Since Jul 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/LucaF87/flysystem-pcloud)[ Packagist](https://packagist.org/packages/lucaf87/flysystem-pcloud)[ GitHub Sponsors](https://github.com/LucaF87)[ RSS](/packages/lucaf87-flysystem-pcloud/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (7)Used By (0)

Flysystem adapter for Laravel
=============================

[](#flysystem-adapter-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/967880a58356f1b1c45a577607f1231918e6b5bb01f38589928a76f6795babc5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c7563616638372f666c7973797374656d2d70636c6f75642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lucaf87/flysystem-pcloud)[![Total Downloads](https://camo.githubusercontent.com/6a1bd34397856681000960ff4ff02850dbadd2b81533f057d0d3b1ff776aebf3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c7563616638372f666c7973797374656d2d70636c6f75642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lucaf87/flysystem-pcloud)

Flysystem adapter for pCloud with support for Laravel v10+.

A PHP library to access [pCloud API](https://docs.pcloud.com/)

---

Get started
-----------

[](#get-started)

### Register your application

[](#register-your-application)

In order to use this package, you have to register your application in [My applications](https://docs.pcloud.com).

---

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require lucaf87/flysystem-pcloud
```

or add the following to `composer.json` file

```
"require": {
  "lucaf87/flysystem-pcloud": "1.0"
}

```

Add the following config to the `disk` array in config/filesystems.php

```
[
    'pCloud' => [
        'driver' => 'pCloud',
        'clientId' => env('PCLOUD_CLIENT_ID'),
        'clientSecret' => env('PCLOUD_CLIENT_SECRET'),
        'accessToken' => env('PCLOUD_ACCESS_TOKEN'),
        'locationId' => env('PCLOUD_LOCATION_ID'),
    ]
]
```

Then set the `FILESYSTEM_DISK` to `pCloud` in your .env

```
FILESYSTEM_DISK=pCloud
```

Publish configuration file

```
php artisan vendor:publish --provider="LucaF87\PCloudAdapter\Providers\CustomPCloudServiceProvider" --force

```

Add the following to your .env

```
PCLOUD_CLIENT_ID=[Get this from https://docs.pcloud.com/my_apps/]
PCLOUD_CLIENT_SECRET=[Get this from https://docs.pcloud.com/my_apps/]
PCLOUD_ACCESS_TOKEN=[leave blank]
PCLOUD_LOCATION_ID=[leave blank]
PCLOUD_LOCAL_FILE_KEEP_ALIVE=60

```

---

Generate Auth
-------------

[](#generate-auth)

### Artisan

[](#artisan)

`php artisan flysystem-pcloud:token`

### Manual

[](#manual)

Generate Authorize Code, Navigate to below link (Replace CLIENT\_ID with your application Client ID) [https://my.pcloud.com/oauth2/authorize?client\_id=CLIENT\_ID&amp;response\_type=code](https://my.pcloud.com/oauth2/authorize?client_id=CLIENT_ID&response_type=code)

After you get the access code and the hostname, next step is to generate Access Token. \*\*Before you navigate to below link, make sure to replace Client ID, Secret and Access Code &amp; THE HOST NAME (api.pcloud.com) with what was on the page before [https://api.pcloud.com/oauth2\_token?client\_id=xxxxxxxxx&amp;client\_secret=xxxxxxxxx&amp;code=xxxxxxxxx](https://api.pcloud.com/oauth2_token?client_id=xxxxxxxxx&client_secret=xxxxxxxxx&code=xxxxxxxxx)

```
Copy the access_token and the locationid to the .env

```

---

Example
-------

[](#example)

```
Storage::disk('pCloud')->putFileAs('files', new File('/tmp/file.txt'), 'file-name.txt');

Storage::disk('pCloud')->exists('/files/file-name.txt'));

$full_path = Storage::disk('pCloud')->get('/files/file-name.txt');
```

**Download file in local storage and return the full path**

```
$full_path = Storage::disk('pCloud')->get('/files/file-name.txt');
```

**Get a cloud link of a file (It may give problems with different IP addresses)**

```
$url = Storage::disk('pCloud')->fileUrl('/files/file-name.txt'));
```

**Download file in local storage and return the content of a file**

```
$contents = Storage::disk('pCloud')->readStream('/files/file-name.txt');
```

**Deleting a file:**

```
Storage::disk('pCloud')->delete('/files/file-name.txt');
```

**Deleting a directory:**

```
Storage::disk('pCloud')->deleteDirectory('/files'));
Storage::disk('pCloud')->deleteDirectory('/files/test'));
```

**Getting the mimetype of a file**

```
$mimeType = Storage::disk('pCloud')->mimeType('/files/file-name.txt');
```

**Get the info of a file**

```
$bytes = Storage::disk('pCloud')->fileInfo('/files/file-name.txt');
```

**Get a list of files**

```
$files = Storage::disk('pCloud')->files('/files'));
```

Clean local storage
-------------------

[](#clean-local-storage)

Since pCloud needs to download files locally in order to access them, I created a command to delete files from local storage older than 1 hour (parameter customizable from config). You just have to schedule it inside the Console/Kernel.php file

```
php artisan flysystem-pcloud:clean-local-storage
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [LucaF87](https://github.com/LucaF87)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~84 days

Total

5

Last Release

711d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8295c2fab88e8b1d1f50e1822a426b26bc62acd80cb208625c83f4dfb84f89a5?d=identicon)[LucaF87](/maintainers/LucaF87)

---

Top Contributors

[![LucaF87](https://avatars.githubusercontent.com/u/62449518?v=4)](https://github.com/LucaF87 "LucaF87 (21 commits)")

---

Tags

flysystemlaravelpcloudstorage

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lucaf87-flysystem-pcloud/health.svg)

```
[![Health](https://phpackages.com/badges/lucaf87-flysystem-pcloud/health.svg)](https://phpackages.com/packages/lucaf87-flysystem-pcloud)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15161.6M2.6k](/packages/illuminate-filesystem)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)[madnest/madzipper

Easier zip file handling for Laravel applications.

1382.3M6](/packages/madnest-madzipper)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
