custom-d/filemaker-for-laravel

A filemaker wrapper for laravel

v3.0.1 2024-02-06 23:18 UTC

This package is auto-updated.

Last update: 2024-11-07 00:48:32 UTC


README

GitHub Workflow Status

Packagist

Package description: Puts filemaker in as a wrapper for Laravel

Installation

Install via composer

composer require custom-d/filemaker-for-laravel inter-mediator/fmdataapi@^21

Versions: | FMData api | FileMaker Version | | --- | --- | | ^27 | 19 | | ^24 | 18 | | ^16.0 | 17 |

Publish package assets

php artisan vendor:publish --provider="CustomD\FilemakerForLaravel\ServiceProvider"

Usage

Update connection settings in the config file or using env variables:

FILEMAKER_DATABASE="Filemaker"
FILEMAKER_HOST="127.0.0.1"
FILEMAKER_USERNAME=WbUser
FILEMAKER_PASSWORD=WbPass
FILEMAKER_PORT=null
FILEMAKER_PROTOCOL=null
FILEMAKER_FMDATASOURCE=null
FILEMAKER_DEBUG=false
FILEMAKER_VERIFY_SSL=false
FILEMAKER_THROW_EXCEPTION_ON_EMPTY=true

the following methods are available:

  • Filemaker::layout(string \$layoutName)
  • Filemaker::setDebug(bool \$enabled)
  • Filemaker::useOAuth()
  • Filemaker::setAPIVersion(int \$vNum)
  • Filemaker::setCertValidating(bool \$value)
  • Filemaker::setSessionToken(string \$value)
  • Filemaker::getSessionToken()
  • Filemaker::curlErrorCode()
  • Filemaker::httpStatus()
  • Filemaker::errorCode()
  • Filemaker::errorMessage()
  • Filemaker::setThrowException(boolean \$value)
  • Filemaker::startCommunication()
  • Filemaker::endCommunication()
  • Filemaker::setGlobalField(array \$fields)
  • Filemaker::getProductInfo(
  • Filemaker::getDatabaseNames()
  • Filemaker::getLayoutNames()
  • Filemaker::getScriptNames()
  • Filemaker::getTargetTable()
  • Filemaker::getTotalCount()
  • Filemaker::getFoundCount()
  • Filemaker::getReturnedCount()

Examples




try {
 $result = Filemaker::layout('person_layout')->query(/*array(array("id" => ">1"))*/);
}
catch (\Exception $e) {
    echo 'An error occured ' . $e->getMessage() . ' - Code : ' . $e->getCode();
}

## OR
Filemaker::setThrowException(false);
$result = Filemaker::layout('layoutname')->query(/** ..  **/)

The 'httpStatus()' method returns the HTTP status code in the latest response.
Filemaker::httpStatus();

see https://github.com/msyk/FMDataAPI/blob/master/samples/FMDataAPI_Sample.php for more examples

Security

If you discover any security related issues, please email instead of using the issue tracker.

Upgrade Guide

V2 - V3

You now need to set the filemaker library version manually - this will allow older and newer filemaker instances on the library.

Credits