-
-
Save arsfeld/3a6995d50128061ba709 to your computer and use it in GitHub Desktop.
Simple FileMaker Laravel 5 Provider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FM_HOST=filemaker.server.com | |
FM_DATABASE=FM_DATABASE | |
FM_USERNAME=admin | |
FM_PASSWORD=admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
... | |
'connections' => [ | |
... | |
'fm' => [ | |
'hostname' => env('FM_HOST', 'localhost'), | |
'dbname' => env('FM_DATABASE', 'FMServer_Sample'), | |
'username' => env('FM_USERNAME', 'Admin'), | |
'password' => env('FM_PASSWORD', '') | |
] | |
] | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace App\Providers; | |
use Illuminate\Contracts\Foundation\Application; | |
use Illuminate\Support\ServiceProvider; | |
use Soliant\SimpleFM\Adapter; | |
class SimpleFMServiceProvider extends ServiceProvider { | |
/** | |
* Bootstrap the application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
} | |
/** | |
* Register the application services. | |
* | |
* @return void | |
*/ | |
public function register() | |
{ | |
$this->app->singleton(Adapter::class, function($app) { | |
return new Adapter($app['config']['database.connections.fm']); | |
}); | |
$this->app->bind('fm', function($app) { | |
/** @var Application $app */ | |
return $app->make(Adapter::class); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment