PHPackages                             graham-campbell/bitbucket - 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. [Framework](/categories/framework)
4. /
5. graham-campbell/bitbucket

ActiveLibrary[Framework](/categories/framework)

graham-campbell/bitbucket
=========================

Bitbucket Is A Bitbucket Bridge For Laravel

v11.0.0(1y ago)75185.0k↑22.1%252MITPHPPHP ^8.1CI passing

Since Jun 12Pushed 1y ago2 watchersCompare

[ Source](https://github.com/GrahamCampbell/Laravel-Bitbucket)[ Packagist](https://packagist.org/packages/graham-campbell/bitbucket)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ Fund](https://tidelift.com/funding/github/packagist/graham-campbell/bitbucket)[ RSS](/packages/graham-campbell-bitbucket/feed)WikiDiscussions 11.0 Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (60)Used By (2)

Laravel Bitbucket
=================

[](#laravel-bitbucket)

Laravel Bitbucket was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is a [Bitbucket PHP API Client](https://github.com/BitbucketPHP/Client) bridge for [Laravel](https://laravel.com/). It utilises my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package. Feel free to check out the [change log](CHANGELOG.md), [releases](https://github.com/GrahamCampbell/Laravel-Bitbucket/releases), [security policy](https://github.com/GrahamCampbell/Laravel-Bitbucket/security/policy), [license](LICENSE), [code of conduct](.github/CODE_OF_CONDUCT.md), and [contribution guidelines](.github/CONTRIBUTING.md).

[![Banner](https://user-images.githubusercontent.com/2829600/71477343-60993680-27e1-11ea-9e70-e6b9e459c31f.png)](https://user-images.githubusercontent.com/2829600/71477343-60993680-27e1-11ea-9e70-e6b9e459c31f.png)

[![Build Status](https://camo.githubusercontent.com/2255845703ba8b89fe00c0350d41195eb1182cc1020099b7ede56f07d14905b4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f47726168616d43616d7062656c6c2f4c61726176656c2d4269746275636b65742f74657374732e796d6c3f6c6162656c3d5465737473267374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-Bitbucket/actions?query=workflow%3ATests)[![StyleCI Status](https://camo.githubusercontent.com/10f53765d336369edd2306cd70d6f26e71adac96c317ec95cddeb85d36e547f9/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f36303737393531332f736869656c64)](https://github.styleci.io/repos/60779513)[![Software License](https://camo.githubusercontent.com/c090e080484e2a2bc766446291d04437db823929042bf614b26a1643660ddf6f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e3f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Downloads](https://camo.githubusercontent.com/653ce390c516960548aefcee52e9ad96ff548388fd0d372c61abc0a02d939146/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67726168616d2d63616d7062656c6c2f6269746275636b65743f7374796c653d666c61742d737175617265)](https://packagist.org/packages/graham-campbell/bitbucket)[![Latest Version](https://camo.githubusercontent.com/182386e53ac32c1b8a2f6bd024fd91ff3c1f83f4792a4bb27d35d2b29c2c4a38/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f47726168616d43616d7062656c6c2f4c61726176656c2d4269746275636b65743f7374796c653d666c61742d737175617265)](https://github.com/GrahamCampbell/Laravel-Bitbucket/releases)

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

[](#installation)

This version requires [PHP](https://www.php.net/) 8.1-8.4 and supports [Laravel](https://laravel.com/) 10-12.

BitbucketL5.5L5.6L5.7L5.8L6L7L8L9L10L11L123.0✅✅❌❌❌❌❌❌❌❌❌4.3✅✅✅✅❌❌❌❌❌❌❌5.5✅✅✅✅✅✅❌❌❌❌❌6.0❌❌❌❌✅✅❌❌❌❌❌7.3❌❌❌❌✅✅✅❌❌❌❌8.1❌❌❌❌✅✅✅✅❌❌❌9.0❌❌❌❌❌❌✅✅❌❌❌10.5❌❌❌❌❌❌✅✅✅✅❌11.0❌❌❌❌❌❌❌❌✅✅✅To get the latest version, simply require the project using [Composer](https://getcomposer.org/):

```
$ composer require "graham-campbell/bitbucket:^11.0"
```

Once installed, if you are not using automatic package discovery, then you need to register the `GrahamCampbell\Bitbucket\BitbucketServiceProvider` service provider in your `config/app.php`.

You can also optionally alias our facade:

```
        'Bitbucket' => GrahamCampbell\Bitbucket\Facades\Bitbucket::class,
```

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

[](#configuration)

Laravel Bitbucket requires connection configuration.

To get started, you'll need to publish all vendor assets:

```
$ php artisan vendor:publish
```

This will create a `config/bitbucket.php` file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

There are two config options:

##### Default Connection Name

[](#default-connection-name)

This option (`'default'`) is where you may specify which of the connections below you wish to use as your default connection for all work. Of course, you may use many connections at once using the manager class. The default value for this setting is `'main'`.

##### Bitbucket Connections

[](#bitbucket-connections)

This option (`'connections'`) is where each of the connections are setup for your application. Example configuration has been included, but you may add as many connections as you would like. Note that the 5 supported authentication methods are: `"jwt"`, `"none"`, `"oauth"`, `"private"` and `"password"`.

##### HTTP Cache

[](#http-cache)

This option (`'cache'`) is where each of the cache configurations setup for your application. Only the "illuminate" driver is provided out of the box. Example configuration has been included.

Usage
-----

[](#usage)

##### BitbucketManager

[](#bitbucketmanager)

This is the class of most interest. It is bound to the ioc container as `'bitbucket'` and can be accessed using the `Facades\Bitbucket` facade. This class implements the `ManagerInterface` by extending `AbstractManager`. The interface and abstract class are both part of my [Laravel Manager](https://github.com/GrahamCampbell/Laravel-Manager) package, so you may want to go and checkout the docs for how to use the manager class over at [that repo](https://github.com/GrahamCampbell/Laravel-Manager#usage). Note that the connection class returned will always be an instance of `Bitbucket\Client`.

##### Facades\\Bitbucket

[](#facadesbitbucket)

This facade will dynamically pass static method calls to the `'bitbucket'` object in the ioc container which by default is the `BitbucketManager` class.

##### BitbucketServiceProvider

[](#bitbucketserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

##### Real Examples

[](#real-examples)

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is `main`. After you enter your authentication details in the config file, it will just work:

```
use GrahamCampbell\Bitbucket\Facades\Bitbucket;
// you can alias this in config/app.php if you like

Bitbucket::currentUser()->show();
// we're done here - how easy was that, it just works!
```

The bitbucket manager will behave like it is a `Bitbucket\Client` class. If you want to call specific connections, you can do with the `connection` method:

```
use GrahamCampbell\Bitbucket\Facades\Bitbucket;

// writing this:
Bitbucket::connection('main')->currentUser()->show();

// is identical to writing this:
Bitbucket::currentUser()->show();

// and is also identical to writing this:
Bitbucket::connection()->currentUser()->show();

// this is because the main connection is configured to be the default
Bitbucket::getDefaultConnection(); // this will return main

// we can change the default connection
Bitbucket::setDefaultConnection('alternative'); // the default is now alternative

// Get all the repositories info
Bitbucket::repositories()->list();

// Get all the repositories info filtered by workspace
Bitbucket::repositories()->workspaces('example')->list();
```

If you prefer to use dependency injection over facades like me, then you can easily inject the manager like so:

```
use GrahamCampbell\Bitbucket\BitbucketManager;

class Foo
{
    public function __construct(
        private readonly BitbucketManager $bitbucket,
    ) {
    }

    public function bar()
    {
        $this->bitbucket->currentUser()->show();
    }
}

app(Foo::class)->bar();
```

For more information on how to use the `Bitbucket\Client` class we are calling behind the scenes here, check out the docs at , and the manager class at .

##### Further Information

[](#further-information)

There are other classes in this package that are not documented here. This is because they are not intended for public use and are used internally by this package.

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . All security vulnerabilities will be promptly addressed. You may view our full security policy [here](https://github.com/GrahamCampbell/Laravel-Bitbucket/security/policy).

License
-------

[](#license)

Laravel Bitbucket is licensed under [The MIT License (MIT)](LICENSE).

For Enterprise
--------------

[](#for-enterprise)

Available as part of the Tidelift Subscription

The maintainers of `graham-campbell/bitbucket` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-graham-campbell-bitbucket?utm_source=packagist-graham-campbell-bitbucket&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance44

Moderate activity, may be stable

Popularity49

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity86

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.7% 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 ~54 days

Recently: every ~0 days

Total

60

Last Release

441d ago

Major Versions

v7.3.1 → v8.0.12021-01-08

7.3.x-dev → v8.0.22021-01-14

v8.1.1 → v9.0.02022-05-31

9.0.x-dev → v10.0.02023-03-07

v10.5.0 → 11.0.x-dev2025-03-03

PHP version history (7 changes)v1.0.0PHP &gt;=5.5.9

v2.0.0PHP ^7.0

v3.0.0PHP ^7.1.3

v6.0.0PHP ^7.2.5

v7.3.0PHP ^7.2.5 || ^8.0

v9.0.0PHP ^7.4.15 || ^8.0.2

11.0.x-devPHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (237 commits)")[![lazabogdan](https://avatars.githubusercontent.com/u/6580668?v=4)](https://github.com/lazabogdan "lazabogdan (3 commits)")[![ppelgrims](https://avatars.githubusercontent.com/u/3612671?v=4)](https://github.com/ppelgrims "ppelgrims (3 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (1 commits)")[![shanecp](https://avatars.githubusercontent.com/u/1654017?v=4)](https://github.com/shanecp "shanecp (1 commits)")

---

Tags

hacktoberfestframeworklaravelbitbucketGraham CampbellGrahamCampbellBridgephp-bitbucket-apibitbucket bridgeLaravel Bitbucket

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graham-campbell-bitbucket/health.svg)

```
[![Health](https://phpackages.com/badges/graham-campbell-bitbucket/health.svg)](https://phpackages.com/packages/graham-campbell-bitbucket)
```

###  Alternatives

[graham-campbell/github

GitHub Is A GitHub Bridge For Laravel

6411.7M19](/packages/graham-campbell-github)[graham-campbell/gitlab

GitLab Is A GitLab Bridge For Laravel

141584.1k2](/packages/graham-campbell-gitlab)[graham-campbell/digitalocean

DigitalOcean Is A DigitalOcean Bridge For Laravel

509343.1k2](/packages/graham-campbell-digitalocean)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[graham-campbell/exceptions

Provides A Powerful Error Response System For Both Development And Production

5911.3M4](/packages/graham-campbell-exceptions)

PHPackages © 2026

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