PHPackages                             jasonbdaro/laravel-sharepoint-upload-client - 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. jasonbdaro/laravel-sharepoint-upload-client

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

jasonbdaro/laravel-sharepoint-upload-client
===========================================

Simple library for file uploading to Microsoft Sharepoint site

01.3kPHP

Since Mar 26Pushed 2y agoCompare

[ Source](https://github.com/jasonbdaro/laravel-sharepoint-upload-client)[ Packagist](https://packagist.org/packages/jasonbdaro/laravel-sharepoint-upload-client)[ RSS](/packages/jasonbdaro-laravel-sharepoint-upload-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Sharepoint Upload Client
================================

[](#laravel-sharepoint-upload-client)

Simple Client for uploading files to Sharepoint Online library. Integrated Laravel Service Provider.

Uses accesscontrol.windows.net OAuth2, so it works with MS ADFS or Azure AAD Authentication.

Usage:
------

[](#usage)

#### Register ServiceProvider in your app.php:

[](#register-serviceprovider-in-your-appphp)

```
\JakubKlapka\LaravelSharepointUploadClient\LaravelSharepointUploadProvider::class
```

#### Use Client factory to make Client instance:

[](#use-client-factory-to-make-client-instance)

```
class Controller {

	protected $sharepointClient;

	public function __construct( \JakubKlapka\LaravelSharepointUploadClient\Factories\ClientFactory $sharepointClient ) {
		$this->sharepointClient = $sharepointClient;
	}

	public function upload() {
		$client = $this->sharepointClient->makeClient( $site_url, $app_id, $app_secret, $redirect_uri );
	}

}
```

You will need those attributes, you can register Sharepoint App on: [https://contoso.sharepoint.com/sites/MySite/\_layouts/15/appregnew.aspx](https://contoso.sharepoint.com/sites/MySite/_layouts/15/appregnew.aspx)

AttributeDescriptionExample*site\_url*Abosolute path to root of your sharepoint site*app\_id*ID of your app*app\_secret*Secret of your app*redirect\_uri*Redirect URI has to match the one, entered on appregnew.aspx#### Point you user to retrieve Consent:

[](#point-you-user-to-retrieve-consent)

```
$url = $client->getUserConsentUri()
```

#### Get refresh token from auth code, returned based on Consent:

[](#get-refresh-token-from-auth-code-returned-based-on-consent)

```
$auth_code = $_REQUEST['code'];
$refreshToken = $client->getRefreshTokenFromAuthCode( $auth_code );
```

*This client does not handle token persistence, feel free to save it to file/db/redis or wherever it is fit for your app.*

Refresh token is valid for 6 months.

#### Use refresh token to upload a file

[](#use-refresh-token-to-upload-a-file)

```
$upload_result = $client->uploadFile(
	$refresh_token,
	'/sites/mySite/myLibrary/',
	'file.txt',
	$this->transfer_storage->readStream( 'file.txt' )
);
```

Resources
---------

[](#resources)

- [https://medium.com/@yash\_agarwal2/performing-oauth-and-rest-calls-with-sharepoint-online-without-creating-an-add-in-677e15c8d6ab](https://medium.com/@yash_agarwal2/performing-oauth-and-rest-calls-with-sharepoint-online-without-creating-an-add-in-677e15c8d6ab)
-

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7a29bdffad5a1a3d29def51d8f986ee954f728203a2a0d33ebce846a4bfd01f9?d=identicon)[jasonbdaro](/maintainers/jasonbdaro)

---

Top Contributors

[![jasonbdaro](https://avatars.githubusercontent.com/u/23290574?v=4)](https://github.com/jasonbdaro "jasonbdaro (5 commits)")[![jakub-klapka](https://avatars.githubusercontent.com/u/5950996?v=4)](https://github.com/jakub-klapka "jakub-klapka (1 commits)")

### Embed Badge

![Health badge](/badges/jasonbdaro-laravel-sharepoint-upload-client/health.svg)

```
[![Health](https://phpackages.com/badges/jasonbdaro-laravel-sharepoint-upload-client/health.svg)](https://phpackages.com/packages/jasonbdaro-laravel-sharepoint-upload-client)
```

###  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)
