PHPackages                             yourivw/sailor - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. yourivw/sailor

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

yourivw/sailor
==============

Extension to Laravel Sail, enabling the user to install additional services to the Sail installation.

v1.0.1(9mo ago)050[5 PRs](https://github.com/yourivw/sailor/pulls)MITPHPPHP ^8.1CI passing

Since Apr 1Pushed 3w ago1 watchersCompare

[ Source](https://github.com/yourivw/sailor)[ Packagist](https://packagist.org/packages/yourivw/sailor)[ RSS](/packages/yourivw-sailor/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (5)Versions (8)Used By (0)

[![](https://raw.githubusercontent.com/yourivw/sailor/main/art/logo.svg)](https://raw.githubusercontent.com/yourivw/sailor/main/art/logo.svg)

[![Testing status](https://github.com/yourivw/sailor/actions/workflows/run-tests.yml/badge.svg)](https://github.com/yourivw/sailor/actions/workflows/run-tests.yml)[![Code coverage](https://raw.githubusercontent.com/yourivw/sailor/gh-pages/badge-coverage.svg)](https://github.com/yourivw/sailor/actions/workflows/coverage.yml)[![Latest stable version](https://camo.githubusercontent.com/b6c0eedfc92e96546593fd9c5c5b50d122d9a02b5e925f2f4cf2037b82e4622f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f75726976772f7361696c6f72)](https://packagist.org/packages/yourivw/sailor)[![License](https://camo.githubusercontent.com/a512ec570912ca6e559224d179817404a2b11b8826c4fed89f93b8caa494567b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f796f75726976772f7361696c6f72)](https://packagist.org/packages/yourivw/sailor)

Introduction
------------

[](#introduction)

This package is an extension to Laravel Sail, enabling the user to install additional services to the Sail installation. The idea behind this, is that this enables you to create an additional package which defines your services which can then be easily installed in your new project consistenly and quickly. The package also gives the options to overwrite which Sail packages are used as default, and how the Laravel service is named.

My own services are available as well, and can be used by installing [yourivw/sailor-services](https://github.com/yourivw/sailor-services).

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

[](#installation)

Install this package as a dev dependency using composer:

`composer require yourivw/sailor --dev`

Defining Sailor services
------------------------

[](#defining-sailor-services)

Services can be defines in two ways: fluently using `SailorService::create()`, and by defining a new class implementing the Serviceable interface. After defining, register the service to the manager using `Sailor::register()` on the Sailor Facade. Alternatively, the SailorService class has a register function, so that the service can be fluently registered.

In both examples, the callbacks can be used for further setup. For example, dynamically adding something to the docker-compose files through the `$compose` argument, using the `$command` argument to write to the output, copying extra files when publishing etc.

Like in these examples, I would advise to check whether the app is running in the console, in order not to uselessly register these services unless your application is running in console.

### Fluent example

[](#fluent-example)

```
if ($this->app->runningInConsole()) {
    SailorService::create('example', __DIR__ . '/../stubs/example.stub')
        ->useDefault()
        ->withVolume()
        ->withPublishable([__DIR__ . '/../example-files' => $this->app->basePath('docker/sailor/example-files')])
        ->callAfterAdding(function (Command $command, array &$compose) {
            $compose['services']['example']['environment']['HELLO'] = 'WORLD';
        })
        ->callAfterPublishing(function (Command $command) {
            $command->info('Successfully published example service files.');
        })
        ->register();
}
```

### Interface example

[](#interface-example)

```
class ExampleService implements Serviceable
{
    public function name(): string
    {
        return 'example';
    }

    public function stubFilePath(): string
    {
        return __DIR__.'/../stubs/example.stub';
    }

    // Other interface functions similair to the fluent example.
}
```

```
if ($this->app->runningInConsole()) {
    Sailor::register(new ExampleService());
}
```

### Other configuration

[](#other-configuration)

```
// Set which Sail services are checked by default.
Sailor::setSailDefaultServices(['mysql', 'redis']);

// Set the default name for the Laravel service.
Sailor::setDefaultServiceName('laravel-example.local');
```

### Note on volumes

[](#note-on-volumes)

Sailor will automatically add a volume when your service has defined it required a volume, in the same way Sail does this. However, these volumes are prefixed with 'sailor-' in the docker-compose file. Be sure to refer to these volumes correctly in your stub file. The volume is named after your service name, plus the sailor- prefix. See example:

```
SailorService::create('redisinsight', __DIR__ . '/../stubs/redisinsight.stub')
    ->withVolume()
    ->register();
```

```
services:
    redisinsight:
        image: '...'
        volumes:
            - 'sailor-redisinsight:/data'
...
volumes:
    sailor-redisinsight:
        driver: local
```

Usage
-----

[](#usage)

### Installation command

[](#installation-command)

The installation command can be used in a similar fashion to the default Sail installation command. Additionally, a check is performed whether a docker-compose file already exists, and if so, an error will be shown. To add a service, use the add command instead. Also, there is an option to directly rename the Laravel service. In the background, Sail's install command will run to handle the installation of the standard services, and this package will handle the custom services. See `sailor:install --help` for more information on usage.

### Add command

[](#add-command)

The add command can be used in a similar fashion to the default Sail add command. Additionally, a check is performed whether a docker-compose file already exists, and if not, an error will be shown. To create a new intallation, use the install command instead. In the background, Sail's add command will run to handle the standard services, and this package will handle the custom services. See `sailor:add --help` for more information on usage.

### Rename command

[](#rename-command)

The rename command can be used to rename the Laravel service. It will find the service in the existing Docker file, and rename it. A line it added to, or edited in the .env file, specifying the new service name. Your Laravel instance will now be reachable on this URL. Ensure this URL points to the correct address for it to work, e.g. by adding it to your Windows hosts file. See `sailor:rename --help` for more information on usage.

Renaming the installation will cause the Sail commands to not find the Laravel installation anymore. It's advised to use only the Sailor commands to add packages to prevent this.

### Publish command

[](#publish-command)

To further ease your workflow when modifying services, your new service can also specify what it should publish, when this is required. An example: the PHP runtimes which Sail can publish for you, in order to customize these. It's not required to define this, and can be skipped all together. When running the publish command, specific services can be chosen using the `--services` option to limit which service files get publishes. See `sailor:publish --help` for more information on usage.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information about recent changes.

Contributing
------------

[](#contributing)

Contributions are more than welcome. Please read the information on issues and PR's below.

### Issues

[](#issues)

- Make sure the issue is reproduceable.
- Make sure the issue has not already been raised.
- Give as much information about the problem as possible.

### Pull requests

[](#pull-requests)

- Make sure additional features add to the functionality of this package.
- Ensure all tests pass, and if required, add tests.
- Do not make PR's adding pre-defined services to this package, these will be closed. This package is purely an interface between Sail and custom services.
- Upon submitting a PR, testing and formatting actions will run automatically.

Testing
-------

[](#testing)

The package uses PHPUnit tests and PHPStan for static analysis.

```
vendor/bin/phpunit
vendor/bin/phpstan

```

Or using Sail:

```
sail bin phpunit
sail bin phpstan

```

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance79

Regular maintenance activity

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 68.4% 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 ~534 days

Total

2

Last Release

280d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/511de6d251ab992c5b1d6a6e6e996fa9e8c28916b5ef270b98611c6e2342fc29?d=identicon)[yourivw](/maintainers/yourivw)

---

Top Contributors

[![yourivw](https://avatars.githubusercontent.com/u/6154644?v=4)](https://github.com/yourivw "yourivw (13 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

dockerlaravellaravel-packagesailsailorlaraveldockersailsailor

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/yourivw-sailor/health.svg)

```
[![Health](https://phpackages.com/badges/yourivw-sailor/health.svg)](https://phpackages.com/packages/yourivw-sailor)
```

###  Alternatives

[laravel/sail

Docker files for running a basic Laravel application.

1.9k199.2M1.2k](/packages/laravel-sail)[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[ryoluo/sail-ssl

Laravel Sail plugin to enable SSL (HTTPS) connection with Nginx.

192739.0k3](/packages/ryoluo-sail-ssl)[aschmelyun/fleet

Run multiple Laravel Sail websites on your local environment

33576.3k](/packages/aschmelyun-fleet)[yoelpc4/laravel-sail-preset

Laravel Sail runtimes &amp; docker-compose.yml preset.

1429.2k](/packages/yoelpc4-laravel-sail-preset)

PHPackages © 2026

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