PHPackages                             jakub-klapka/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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jakub-klapka/laravel-sharepoint-upload-client

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jakub-klapka/laravel-sharepoint-upload-client
=============================================

Simple library for file uploading to Microsoft Sharepoint site

v1.0.2(5y ago)79.5k↓45.8%5[2 issues](https://github.com/jakub-klapka/laravel-sharepoint-upload-client/issues)MITPHPPHP &gt;=5.6CI failing

Since Apr 7Pushed 5y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (3)Versions (4)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

33

—

LowBetter than 75% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~680 days

Total

3

Last Release

1968d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e5cec74f264ced2aadae4c91668bcc009f0823f868b402b759c02a873cca9223?d=identicon)[jakub-klapka](/maintainers/jakub-klapka)

---

Top Contributors

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

---

Tags

oauthmicrosoftuploadsharepoint

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[overtrue/socialite

A collection of OAuth 2 packages.

1.4k5.5M87](/packages/overtrue-socialite)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[socialiteproviders/microsoft-azure

Microsoft Azure OAuth2 Provider for Laravel Socialite

556.0M19](/packages/socialiteproviders-microsoft-azure)[stevenmaguire/oauth2-microsoft

Microsoft OAuth 2.0 Client Provider for The PHP League OAuth2-Client

742.3M12](/packages/stevenmaguire-oauth2-microsoft)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

326.1M13](/packages/socialiteproviders-microsoft)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

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