PHP code example of jubeki / orbit-git

1. Go to this page and download the library: Download jubeki/orbit-git 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/ */

    

jubeki / orbit-git example snippets


// existing providers...
Jubeki\OrbitGit\OrbitGitServiceProvider::class,

use Jubeki\OrbitGit\Facades\OrbitGit;

public function boot()
{
    OrbitGit::resolveNameUsing(function () {
        return Auth::user()->name;
    });

    OrbitGit::resolveEmailUsing(function () {
        return Auth::user()->email;
    });
}

use Jubeki\OrbitGit\Facades\OrbitGit;

public function boot()
{
    OrbitGit::resolveMessageUsing(function ($event) {
        return (string) Str::of(config('orbit-git.message_template'))
                ->replace('{event}', $this->getTypeOfEvent($event))
                ->replace('{model}', class_basename($event->model))
                ->replace('{primary_key}', $event->model->getKey());
    });
}

use Jubeki\OrbitGit\Facades\OrbitGit;

public function boot()
{
    OrbitGit::resolveCreatedMessageUsing(function ($event) {
        return '...',
    });

    OrbitGit::resolveDeletedMessageUsing(function ($event) {
        return '...',
    });

    OrbitGit::resolveForceDeletedMessageUsing(function ($event) {
        return '...',
    });

    OrbitGit::resolveUpdatedMessageUsing(function ($event) {
        return '...',
    });
}