PHP code example of danielcrt / pinata-laravel

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

    

danielcrt / pinata-laravel example snippets


return [

    ...

    'pinata' => [

        'api_key' => env('PINATA_API_KEY'),
        'secret_key' => env('PINATA_API_SECRET')
    ]
]

'providers' => [

    ...

    \Pinata\Providers\PinataServiceProvider::class,
]


$app->configure('services');
$app->register(Pinata\Providers\PinataServiceProvider::class);


  use Pinata\Facades\Pinata;

  $file_path = '';

  $response = Pinata::pinFileToIPFS($file_path);

  use Pinata\Facades\Pinata;

  $json = [];

  $response = Pinata::pinJSONToIPFS($json);

  use Pinata\Facades\Pinata;

  $ipfs_hash = '';

  $response = Pinata::removePinFromIPFS($ipfs_hash);
config/services.php
config/app.php
bootstrap/app.php