|
1 | | -# Eloquent FileMaker |
| 1 | +# Eloquent-FileMaker |
2 | 2 | Eloquent-FileMaker is a PHP package for Laravel to make working with FileMaker databases through the FileMaker Data API easier. The goal of this project is to provide as similar an interface for working with FileMaker records through the Data API as you would get with working with MySQL in native Laravel. |
3 | 3 |
|
4 | 4 | This package lets you easily connect to your FileMaker database through the Data API and get record data as Laravel Models, with as many native features supported as possible. |
@@ -211,7 +211,7 @@ With this package in place the `DB` facade will still work for queries against y |
211 | 211 |
|
212 | 212 | Like the FMModel class and Eloquent builder, the goal is to support the same set of features as the `DB` facade so check out the [Laravel Query Builder Documentation](https://laravel.com/docs/8.x/queries) to see what the basic query builder features are. |
213 | 213 |
|
214 | | -### FileMaker-specific Features in the FilMaker Query Builder and FM Facade |
| 214 | +### FileMaker-specific Features in the FileMaker Query Builder and FM Facade |
215 | 215 |
|
216 | 216 | In addition to the basic query builder features, the `FMBaseQueryBuilder` class, accessed through the `FM` facade or the FMModel eloquent builder has many new FileMaker-specific methods which are available. |
217 | 217 |
|
@@ -301,6 +301,21 @@ FM::layout('MyLayoutName')->script('ScriptName')->fieldData($data)->createRecord |
301 | 301 |
|
302 | 302 | ``` |
303 | 303 |
|
| 304 | +## Logging out, disconnecting, and ending your Data API session |
| 305 | + |
| 306 | +Eloquent-FileMaker attempts to automatically re-use session tokens by caching the session token between requests. This means that you will see the session remain open in your FileMaker Server admin console. It will be automatically disconnected by your server based on your server or database's disconnection settings. |
| 307 | + |
| 308 | +If you would like to manually log out and end your session you can do so either through the FM facade or through a model. |
| 309 | + |
| 310 | +``` |
| 311 | +FM::connection()->disconnect(); |
| 312 | +``` |
| 313 | + or |
| 314 | +``` |
| 315 | +MyModel::getConnectionResolver()->connection()->disconnect(); |
| 316 | +``` |
| 317 | + |
| 318 | + |
304 | 319 |
|
305 | 320 | ## Relating Native Laravel models to FMModels |
306 | 321 | It is possible to have relationships between native Laravel Model objects from your MySQL database and FMModels created from your FileMaker database. To do this, you will need to set up both connections in your `database.config` file and then make sure your models are pointing to the right connection by setting the `$connection` propety in your Model and FMModel classes. |
|
0 commit comments