PHP code example of restoore / therefore

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

    

restoore / therefore example snippets


Restoore\Therefore\ThereforeServiceProvider::class

'Therefore' => Restoore\Therefore\Facades\Therefore::class

THEREFORE_WSDL=
THEREFORE_LOGIN=
THEREFORE_PASSWORD=

use \Restoore\Therefore\ThereforeTrait;

    //therefore
    use \Restoore\Therefore\ThereforeTrait;
    protected $thereforeCategoryNo = 8;
    protected $thereforeFieldNo = 92;
    protected $thereforeSearchableField = 'id';

$class->refreshCacheFiles();
dd($class->listDocuments());

Collection {#545 ▼
  #items: array:1 [▼
    0 => ThereforeDocument {#539 ▼
      #fillable: array:7 [▼
        0 => "categoryNo"
        1 => "docNo"
        2 => "versionNo"
        3 => "searchableField"
        4 => "lastChangeTime"
        5 => "title"
        6 => "ctgryName"
      ]
     ...
    }
  ]
}

@foreach($documents as $document)
    @foreach($document->files as $file)
		...
	@endforeach
@endforeach

ThereforeFile {#554 ▼
  #fillable: array:4 [▼
    0 => "therefore_document_id"
    1 => "streamNo"
    2 => "fileName"
    3 => "size"
  ]
  ...
    }
  ]
}

$thereforedocument->categoryNo
$thereforedocument->lastChangeTime
$thereforedocument->ctgryName
$thereforefile->fileName
$thereforefile->size

  public function getFullPath()						//Get full server path
  public function getFileNameWithoutExtension() 	//Get filename without his extension
  public function getExtension()					//Only get the extension
  public function deleteFromServer()				//Delete file from web server
  public function getUrl()							//Return full link of your file
  public function getSizeAttribute($value)			//Return formatted size of your file like "16.5 Mo" or "500 ko"
  public function getThumbnailUrl()					//Return thumbnail url and if thumbnail doesn t exist create him
  public function deleteThumbnail()					//Delete thumbnail from web server

php artisan vendor:publish --provider="Restoore\Therefore\ThereforeServiceProvider" --tag="config"

php artisan vendor:publish --provider="Restoore\Therefore\ThereforeServiceProvider" --tag="migrations"

php artisan migrate

php artisan vendor:publish --provider="Restoore\Therefore\ThereforeServiceProvider" --tag="config"