PHP code example of bernskioldmedia / laravel-harvest

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

    

bernskioldmedia / laravel-harvest example snippets


return [

    /**
     * The API key used for authenticating with the Harvest API.
     */
    'api_key' => env('HARVEST_API_KEY', ''),

    /**
     * The Account ID number from Harvest that you want to use.
     */
    'account_id' => env('HARVEST_ACCOUNT_ID', ''),

    /**
     * The user agent (application name) is sent through to
     * Harvest so that they can identify who requests come from.
     */
    'application_name' => env('HARVEST_APP_NAME', env('APP_NAME')),

    /**
     * The contact e-mail address for the application is 

use BernskioldMedia\Harvest\Facades\Harvest;

// Get all clients from Harvest.
Harvest::clients()->all();

// Show only active clients from Harvest.
Harvest::clients()->active()->all();

// Get a single client from Harvest.
Harvest::clients()->get(123);

// Create a client from Harvest.
Harvest::clients()->create(['name' => 'My new client']);

// Update a client in Harvest.
Harvest::clients()->update(123, ['name' => 'My new name']);

// Delete a client from Harvest.
Harvest::clients()->delete(123);

// Mark an invoice as sent.
Harvest::invoices()->send(1);
bash
php artisan vendor:publish --tag="harvest-config"