PHP code example of yourivw / sailor

1. Go to this page and download the library: Download yourivw/sailor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yourivw / sailor example snippets


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();
}

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());
}

// 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');

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