Getting started

Installing package into your Laravel application.

Grab the dependency with Composer:

composer require open-southeners/laravel-companion-apps

Publish config file

php artisan vendor:publish --provider="OpenSoutheners\\LaravelCompanionApps\\ServiceProvider"

Register your applications

To register your companion applications you should call this on your AppServiceProvider:

<?php

namespace App\Providers;

use OpenSoutheners\LaravelCompanionApps\CompanionApplication;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     */
    public function boot(): void
    {
        // Rest of your code...
        
        \OpenSoutheners\LaravelCompanionApps\ServiceProvider::loadApplications([
            CompanionApplication::make('com.example', Platform::Android)
                ->linkScheme('example'),

            CompanionApplication::make('com.example_preview', Platform::Android)
                ->linkScheme('example'),

            CompanionApplication::make('com.example', Platform::Apple)
                ->linkScheme('example')
                ->setStoreOptions(id: '123456789', slug: 'example_app')
        ]);
    }
}

Last updated