PHPackages                             thyyppa/laravel-fluent-fm - 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. [Database &amp; ORM](/categories/database)
4. /
5. thyyppa/laravel-fluent-fm

ActiveLibrary[Database &amp; ORM](/categories/database)

thyyppa/laravel-fluent-fm
=========================

A Laravel package for FileMaker Server's Data API using a fluent query builder style interface.

1.1.4(5y ago)35301[2 issues](https://github.com/thyyppa/laravel-fluent-fm/issues)[3 PRs](https://github.com/thyyppa/laravel-fluent-fm/pulls)MITPHPPHP &gt;=7.2CI failing

Since Apr 24Pushed 4y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (4)Versions (26)Used By (0)

Laravel FluentFM [![](https://camo.githubusercontent.com/52c0fe050c1256277e3b1a1c57bd217bde9b578aca9d34c7f0f848f90384a1a0/68747470733a2f2f7472617669732d63692e6f72672f746879797070612f6c61726176656c2d666c75656e742d666d2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/thyyppa/laravel-fluent-fm) [![](https://camo.githubusercontent.com/0956c7829a87fd8689ed0e366823f91779b4ae1edd4a40d0602b344316955332/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3138333237363033342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/183276034)
==================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#laravel-fluentfm--)

FluentFM is a PHP package that connects to FileMaker Server's Data API using a fluent query builder style interface.

### Requirements

[](#requirements)

- PHP 7.2+
- FileMaker Server 17
- Laravel 5+

### Installation

[](#installation)

#### Using Composer

[](#using-composer)

Use the command

`composer require thyyppa/laravel-fluent-fm`

or include in your `composer.json` file

```
{
    "require": {
        "thyyppa/laravel-fluent-fm": "dev-master"
    }
}
```

#### Prepare FileMaker

[](#prepare-filemaker)

**Important! All tables and layouts *must* contain an `id` field.**

If you wish to use soft deletes your table and layout *must* contain the field `deleted_at`

The following fields are also recommended:

- `created_at` (for sorting by latest)
- `updated_at` (for sorting by last update)

All fields that you wish to access must be available in the layout that you provide while performing FileMaker operations through the api.

Ideally these will be hidden layouts that contain all fields raw, mirroring the table, but depending on your layout structure you may be able to use existing human-facing layouts.

[![](./assets/layout_thumbnail.png)](./assets/layout_thumbnail.png)[![](./assets/container_thumbnail.png)](./assets/container_thumbnail.png)[![](./assets/database_thumbnail.png)](./assets/database_thumbnail.png)Ensure that `fmrest` is enabled on your privilege set, which you can define in

`File > Manage > Security > [highlight user] > Privilege Set [Edit]`

[![](./assets/privileges_thumbnail.png)](./assets/privileges_thumbnail.png)

Also be sure that the Data API is enabled on the server.

If your server is installed locally this link should take you there:

Otherwise replace `localhost` with the server address.

[![](./assets/admin_thumbnail.png)](./assets/admin_thumbnail.png)

---

### Register package

[](#register-package)

This package features auto-discovery, so registering the provider and facade should not be necessary, but if for any reason auto-discovery does not work for you, you can register the package manually as shown below.

Register the service provider in `config/app.php` (optional)

```
'providers' => [
    // Other Service Providers

    Hyyppa\LaravelFluentFM\Providers\LaravelFluentFMServiceProvider::class,
],
```

Register the facade alias in `config/app.php` (optional)

```
'aliases' => [
    // Other Aliases

    Hyyppa\LaravelFluentFM\Facades\FluentFM::class,
]
```

### Config

[](#config)

Publish the config files by running (optional)

```
php ./artisan vendor:publish --provider="Hyyppa\\LaravelFluentFM\\Providers\\LaravelFluentFMServiceProvider"
```

### Set Environment Variables

[](#set-environment-variables)

In your `.env` file, add the following items

```
FILEMAKER_FILE=[FileMaker file name without extension]
FILEMAKER_HOST=[FileMaker server address]
FILEMAKER_USER=[FileMaker file user]
FILEMAKER_PASS=[FileMaker file password]
```

### Usage

[](#usage)

#### Getting records from layout

[](#getting-records-from-layout)

```
