From df6b628f6b53195b6aad154e290c2f2215931b1f Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 20 Feb 2024 14:42:00 +0000 Subject: [PATCH 1/5] CHanged readme into usable examples for both basic and laravel support --- .github/logo-dark.svg | 15 ++++++ .github/logo-light.svg | 15 ++++++ README.md | 109 ++++++++++++++++++++++++++++++++++++++--- 3 files changed, 131 insertions(+), 8 deletions(-) create mode 100644 .github/logo-dark.svg create mode 100644 .github/logo-light.svg diff --git a/.github/logo-dark.svg b/.github/logo-dark.svg new file mode 100644 index 0000000..52794d7 --- /dev/null +++ b/.github/logo-dark.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/.github/logo-light.svg b/.github/logo-light.svg new file mode 100644 index 0000000..517ad23 --- /dev/null +++ b/.github/logo-light.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 06f59a1..6470eee 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,38 @@ -# PHP client library for consuming the FileMaker Data API +

+ + Filemaker Data API logo + + + Filemaker Data API logo + +

+ +

+ Easy to use wrapper for the read and write filemaker api connection made to work.
Available as basic PHP usage and via first-party Laravel framework. +

+ +

+ + Total Downloads + + + Latest Release + + + License + +

-PHP package (client library) for consuming the FileMaker Data API, with Laravel support. - -## Install +## Basic Usage -Via Composer: +First, install flooris/filemaker-data-api from Composer: ```bash composer require flooris/filemaker-data-api ``` - -## Basic Usage +Then the basic use of finding a record and their output. More information can be found in the Wiki ```php // Include Composer's autoloader. @@ -19,7 +40,7 @@ require_once __DIR__ . '/vendor/autoload.php'; // Define the pagination variables $offset = 1; -$limit = 100; +$limit = 100; // Define the FileMaker Lay-out $layoutName = 'Products'; @@ -51,6 +72,78 @@ foreach ($result->data as $fmResultObject) { } ``` +## Laravel +First, install flooris/filemaker-data-api from composer: +```bash +composer require flooris/filemaker-data-api +``` +
+ +You can use the basic configuration file the config file by running the following command. +```bash +php artisan vendor:publish --tag="filemaker-data-api" +``` + +This will get the published config file with the following contents: +```php +return [ + 'default' => [ + 'hostname' => env('FM_HOSTNAME=192.168.10.33 +FM_PORT=80 +FM_DATABASE=Hurricane +FM_USERNAME= +FM_PASSWORD='), + 'port' => env('FM_PORT', null), + 'protocol' => env('FM_PROTOCOL', 'https://'), + + 'version' => env('FM_VERSION', 'v1'), // v1 or vLatest + 'database' => env('FM_DATABASE', 'default'), + + 'username' => env('FM_USERNAME'), + 'password' => env('FM_PASSWORD'), + ], + 'settings' => [ + 'boolean_true_values' => ['true', '1', 'yes', 'y', 'j', 'ja'], + 'date_format' => env('FM_DATE_FORMAT', 'm-d-Y'), + 'session_ttl' => env('FM_SESSION_TTL', 400), + ], +]; +``` + +Then you can setup the env variables. +```dotenv +FM_HOSTNAME= +FM_PORT=80 +FM_DATABASE= +FM_USERNAME= +FM_PASSWORD= +``` + +Now you can setup a tinker script to test the connection and use it as basic as possible +```php +// Define the pagination variables +$offset = 1; +$limit = 100; + +// Define the FileMaker Lay-out +$layoutName = 'Products'; + +// Set up the FileMaker find query +$findQuery = [ + 'some_field_name' => 'text to find', +]; + +// Set up the client. +$client = new \Flooris\FileMakerDataApi\Client(); + +$result = $client + ->record($layoutName) + ->findRecords($findQuery, $offset, $limit) +``` + + + + ## Advanced usage Define a Model Class for a FileMaker record, for example: `FmBrandObject`. From d060f0aabf1820388b9c7f2bccc18fa7fafd8e4b Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 20 Feb 2024 14:44:24 +0000 Subject: [PATCH 2/5] changed dark and light mode support --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6470eee..b1218a9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

- + Filemaker Data API logo - + Filemaker Data API logo

From 1960d6350e9760d1a727402b8ec43f22fb49f147 Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 20 Feb 2024 14:46:54 +0000 Subject: [PATCH 3/5] Changed total downloads into one Lines --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b1218a9..588fde5 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@

- Total Downloads + Total Downloads Latest Release From 140230197104e5f1f412d9f9b6ead6c2acdd5e7a Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 20 Feb 2024 14:48:51 +0000 Subject: [PATCH 4/5] switched dark and light mode since wrong naming --- .github/logo-dark.svg | 16 ++++++++-------- .github/logo-light.svg | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/logo-dark.svg b/.github/logo-dark.svg index 52794d7..517ad23 100644 --- a/.github/logo-dark.svg +++ b/.github/logo-dark.svg @@ -1,15 +1,15 @@ - - - - - - + + + + + + - + - + diff --git a/.github/logo-light.svg b/.github/logo-light.svg index 517ad23..52794d7 100644 --- a/.github/logo-light.svg +++ b/.github/logo-light.svg @@ -1,15 +1,15 @@ - - - - - - + + + + + + - + - + From ef1c66c203d080045b41c657eee9c45a47de0619 Mon Sep 17 00:00:00 2001 From: Jasper Date: Tue, 20 Feb 2024 14:49:57 +0000 Subject: [PATCH 5/5] fixed contents of readme config values. --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 588fde5..1fa209d 100644 --- a/README.md +++ b/README.md @@ -87,14 +87,9 @@ This will get the published config file with the following contents: ```php return [ 'default' => [ - 'hostname' => env('FM_HOSTNAME=192.168.10.33 -FM_PORT=80 -FM_DATABASE=Hurricane -FM_USERNAME= -FM_PASSWORD='), + 'hostname' => env('FM_HOSTNAME'), 'port' => env('FM_PORT', null), 'protocol' => env('FM_PROTOCOL', 'https://'), - 'version' => env('FM_VERSION', 'v1'), // v1 or vLatest 'database' => env('FM_DATABASE', 'default'),