PHP code example of atomicptr / laravel-github-storage

1. Go to this page and download the library: Download atomicptr/laravel-github-storage 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/ */

    

atomicptr / laravel-github-storage example snippets


'github' => [
    'driver' => 'github',
    'token' => env('GITHUB_STORAGE_TOKEN', ''),
    'username' => env('GITHUB_STORAGE_USERNAME', ''),
    'repository' => env('GITHUB_STORAGE_REPOSITORY', ''),
    'branch' => env('GITHUB_STORAGE_BRANCH', 'master'),
    'prefix' => env("GITHUB_STORAGE_PREFIX", ''),
],



return [
    App\Providers\AppServiceProvider::class,
    // This line:
    Atomicptr\LaravelGithubStorage\GithubStorageServiceProvider::class,
];



$storage = Storage::disk('github');

if (! $storage->exists('assets/image.jpg')) {
    $storage->put('assets/', $imageFileContent);
}

// See https://laravel.com/docs/filesystem