PHPackages                             monicahq/laravel-sabre - 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. [API Development](/categories/api)
4. /
5. monicahq/laravel-sabre

ActiveLibrary[API Development](/categories/api)

monicahq/laravel-sabre
======================

Sabre DAV server adapter for Laravel.

1.9.0(1y ago)58434.2k↑32.4%9[4 issues](https://github.com/monicahq/laravel-sabre/issues)[5 PRs](https://github.com/monicahq/laravel-sabre/pulls)MITPHPCI passing

Since Mar 2Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/monicahq/laravel-sabre)[ Packagist](https://packagist.org/packages/monicahq/laravel-sabre)[ GitHub Sponsors](https://github.com/asbiin)[ RSS](/packages/monicahq-laravel-sabre/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (27)Used By (0)

Sabre adapter for Laravel
=========================

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

Laravel-Sabre is an adapter to use Sabre.io DAV Server on Laravel.

[![Latest Version](https://camo.githubusercontent.com/accdad52d503668ca13361850fafb0909aba479ea6c58b3b3ef2698b42184fce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e69636168712f6c61726176656c2d73616272653f7374796c653d666c61742d737175617265266c6162656c3d4c617465737425323056657273696f6e)](https://github.com/monicahq/laravel-sabre/releases)[![Downloads](https://camo.githubusercontent.com/829aad75e080d7eb5b801d5846aeefe243854caa85b6d613a76a3fe0bce7bd1d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f6e69636168712f6c61726176656c2d73616272653f7374796c653d666c61742d737175617265266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/monicahq/laravel-sabre)[![Workflow Status](https://camo.githubusercontent.com/2c7002c3aa6b8dd470b1f2e0554302f926810dea0638c6e416dc562eeb8f7ddb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6f6e69636168712f6c61726176656c2d73616272652f556e697425323074657374733f7374796c653d666c61742d737175617265266c6162656c3d576f726b666c6f77253230537461747573)](https://github.com/monicahq/laravel-sabre/actions?query=branch%3Amain)[![Quality Gate](https://camo.githubusercontent.com/e299726f6da611ddb1ec57fc1f7313745d0e278e2e9d8fefa21faa1b33d078fe/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f7175616c6974795f676174652f6d6f6e69636168715f6c61726176656c2d73616272653f7365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f267374796c653d666c61742d737175617265266c6162656c3d5175616c69747925323047617465)](https://sonarcloud.io/dashboard?id=monicahq_laravel-sabre)[![Coverage Status](https://camo.githubusercontent.com/1db842cc69cfcef0d95dcf6d9f99b9e5d9a9f90138650c0b8d53b2c93ff525f8/68747470733a2f2f696d672e736869656c64732e696f2f736f6e61722f636f7665726167652f6d6f6e69636168715f6c61726176656c2d73616272653f7365727665723d6874747073253341253246253246736f6e6172636c6f75642e696f267374796c653d666c61742d737175617265266c6162656c3d436f766572616765253230537461747573)](https://sonarcloud.io/dashboard?id=monicahq_laravel-sabre)

Installation
============

[](#installation)

You may use Composer to install this package into your Laravel project:

```
composer require monicahq/laravel-sabre
```

You don't need to add this package to your service providers.

Configuration
-------------

[](#configuration)

If you want, you can publish the package config file to `config/laravelsabre.php`:

```
php artisan vendor:publish --provider="LaravelSabre\LaravelSabreServiceProvider"
```

If desired, you may disable LaravelSabre entirely using the `enabled` configuration option:

```
'enabled' => env('LARAVELSABRE_ENABLED', true),
```

Change the `path` configuration to set the url path where the Sabre server will answer to.

Usage
=====

[](#usage)

Use `LaravelSabre\LaravelSabre` class to add node collection and plugins to the Sabre server.

In the example above, `DAVServiceProvider` is a service provider that has been added to the list of providers in `config/app.php` file.

Nodes
-----

[](#nodes)

`LaravelSabre::nodes()` is used to add nodes collection to the Sabre server.

It may be an array, or a callback function, like in this example here:

Example:

```
use LaravelSabre\LaravelSabre;
use Sabre\DAVACL\PrincipalCollection;
use Sabre\DAVACL\PrincipalBackend\PDO as PrincipalBackend;

class DAVServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        LaravelSabre::nodes(function () {
            return $this->nodes();
        });
    }

    /**
     * List of nodes for DAV Collection.
     */
    private function nodes() : array
    {
        $principalBackend = new PrincipalBackend();

        return [
            new PrincipalCollection($principalBackend),
        ];
    }
}
```

Plugins
-------

[](#plugins)

You can use either:

- `LaravelSbre::plugins()` to define a new array of plugins to add to the Sabre server. It may be a callback function.
- or `LaravelSbre::plugin()` to add 1 plugin to the list of plugins.

Example:

```
use LaravelSabre\LaravelSabre;
use LaravelSabre\Http\Auth\AuthBackend;
use Sabre\DAV\Auth\Plugin as AuthPlugin;
use Sabre\CardDAV\Plugin as CardDAVPlugin;

class DAVServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        LaravelSabre::plugins(function () {
            return $this->plugins();
        });
    }

    /**
     * List of Sabre plugins.
     */
    private function plugins()
    {
        // Authentication backend
        $authBackend = new AuthBackend();
        yield new AuthPlugin($authBackend);

        // CardDAV plugin
        yield new CardDAVPlugin();
    }
}
```

Auth
----

[](#auth)

Use the `LaravelSabre::auth()` method with the `Authorize::class` middleware gate, to allow access to some people, based on some criteria.

Example:

```
LaravelSabre::auth(function () {
    return auth()->user()->email == 'admin@admin.com';
})
```

License
=======

[](#license)

Author: [Alexis Saettler](https://github.com/monicahq)

This project is part of [MonicaHQ](https://github.com/monicahq/).

Copyright © 2019–2022.

Licensed under the MIT License. [View license](/LICENSE.md).

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance68

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~282 days

Total

20

Last Release

439d ago

Major Versions

0.1.1 → 1.0.02019-04-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e66caa78edaffa8e41c951f9bb469ae0c91ecdf1e1dc7bdfee847d127a5d4d4?d=identicon)[asbin](/maintainers/asbin)

---

Top Contributors

[![asbiin](https://avatars.githubusercontent.com/u/25419741?v=4)](https://github.com/asbiin "asbiin (54 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (46 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![MonicaBot](https://avatars.githubusercontent.com/u/40141970?v=4)](https://github.com/MonicaBot "MonicaBot (4 commits)")

---

Tags

caldavcardavdavhacktoberfestsabresabre-serverphplaravelsabredav

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/monicahq-laravel-sabre/health.svg)

```
[![Health](https://phpackages.com/badges/monicahq-laravel-sabre/health.svg)](https://phpackages.com/packages/monicahq-laravel-sabre)
```

###  Alternatives

[resend/resend-laravel

Resend for Laravel

1191.4M6](/packages/resend-resend-laravel)[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162145.5k1](/packages/joisarjignesh-bigbluebutton)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.1k](/packages/dariusiii-tmdb-laravel)[madeitbelgium/wordpress-php-sdk

WordPress Laravel PHP SDK

4422.9k1](/packages/madeitbelgium-wordpress-php-sdk)[dystcz/lunar-api

Dystore API layer for Lunar e-commerce package

411.1k3](/packages/dystcz-lunar-api)[gufy/whmcs

WHMCS API for Laravel 5

201.7k](/packages/gufy-whmcs)

PHPackages © 2026

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