ifresh/filemaker-model

There is no license information available for the latest version (0.1.21) of this package.

An model wrapper for the filemaker api

0.1.21 2022-07-12 11:57 UTC

This package is auto-updated.

Last update: 2024-11-12 16:54:27 UTC


README

Installation

Install the package using composer

composer require ifresh/filemaker-model

After installation publish the config file using

php artisan vendor:publish --provider='Ifresh\FilemakerModel\FilemakerModelServiceProvider'

The model

Create a new FilemakerModel using the following command. Mind that the Modelname argument will be the classname of the generated model. You are encouraged to use the Laravel naming conventions.

php artisan filemaker:model Modelname

Set the layout name in the generated model file

protected $layout = 'filemaker_layout_name'

Getting your data

Get your records

App\Filemaker\Modelname::all();
// returns an eloquent collection with all models

If you know the Filemaker internal recordId, you can fetch records with the find method.

App\Filemaker\Modelname::find(234);
// returns a single model instance

Create a record

You can create records with ease by using an eloquent like method:

$recordId = App\Filemaker\Modelname::create([
    'key1' => 'value',
    'key2' => 'value2'
]);
// returns the given recordId