PHPackages                             restoore/therefore - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. restoore/therefore

ActiveLibrary[API Development](/categories/api)

restoore/therefore
==================

Integration package of Therefore Web API into Laravel applications

1.0.2(9y ago)016MITPHPPHP &gt;=5.4

Since Aug 26Pushed 9y ago1 watchersCompare

[ Source](https://github.com/restoore/laravel-therefore)[ Packagist](https://packagist.org/packages/restoore/therefore)[ RSS](/packages/restoore-therefore/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

laravel-therefore
=================

[](#laravel-therefore)

This a package to integrate Therefore Webservice with Laravel 5. It includes a ServiceProvider to register the webservice. You also have facade to use increase the webservice usage.

Installation for Laravel 5.x
============================

[](#installation-for-laravel-5x)

Require this package with composer :

```
composer require restoore/laravel-therefore

```

After updating composer, add the ServiceProvider to the providers array in config/app.php

```
Restoore\Therefore\ThereforeServiceProvider::class
```

If you want to use the facade add this to your facades in your app.php

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

Copy the package config to your local config with the publish command :

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

```

Copy migration files to your local migration folder with the publish command :

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

```

Launch migration :

```
php artisan migrate

```

Configuration
-------------

[](#configuration)

If you have used the following command :

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

```

You've a therefore.php in your local config path, by default : /config/therefore.php, if not, you have to create this file. In this file, you have four parameters that have to be returned in an array :

- **wsdl**, url of your therefore wsld file
- **login**, your therefore account login
- **password**; your threfore account password
- **file\_path**, file location where your want to save files and thumbnails. All files will be saved in your laravel public folder. For exemple, if you put docs/therefore/, all files we be created in public/docs/therefore/

### Environment

[](#environment)

If you want to use different environments of development, you can override wsdl, login and password parameters by using **.env** file.

```
THEREFORE_WSDL=
THEREFORE_LOGIN=
THEREFORE_PASSWORD=
```

Usage
-----

[](#usage)

You can now connect your model to Therefore document by using php traits. First, you have to add ThereforeTrait to your model :

```
use \Restoore\Therefore\ThereforeTrait;
```

Now you have to configure attributes to bind your model to Therefore documents :

- $thereforeCategoryNo will contain CategoryNo from your Therefore document
- $thereforeFieldNo will contain the id of the field you want to use to link Therefore document and your model
- $thereforeSearchableField will contain the name of your model attribute witch will be used to linked your model This should looks like this :

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

In this example the model id have to be the same that the value in the field 92 of the Therefore document.

### Retrieve documents and files

[](#retrieve-documents-and-files)

Now you can use function **listDocuments** to retrieve all linked documents of your model. For example :

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

will produce for my example :

```
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"
      ]
     ...
    }
  ]
}
```

**refreshCacheFiles** will check if you have last version of documents and update database and files. You can decide to not use this function everytime and let user manually refresh file list.

Now if you want files of a document :

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

Here you have file model structure :

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

All attributes of ThereforeDocument and ThereforeFile can be reachable with their names. For example :

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

#### Some useful functions from ThereforeFile model

[](#some-useful-functions-from-thereforefile-model)

```
  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
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~12 days

Total

3

Last Release

3572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0988c2fd58cb4a3ff1ee8500692d29c66a4297267369c9d5e9e7c3583d019bf4?d=identicon)[restoore](/maintainers/restoore)

---

Top Contributors

[![restoore](https://avatars.githubusercontent.com/u/7040754?v=4)](https://github.com/restoore "restoore (7 commits)")

### Embed Badge

![Health badge](/badges/restoore-therefore/health.svg)

```
[![Health](https://phpackages.com/badges/restoore-therefore/health.svg)](https://phpackages.com/packages/restoore-therefore)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M966](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M130](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M62](/packages/knuckleswtf-scribe)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
