lifeboat / silverstripe
Lifeboat PHP SDK - Silverstripe Wrapper
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:silverstripe-vendormodule
Requires
- php: ^7.2 || ^8.0
- lifeboat/php-sdk: dev-main
- silverstripe/config: ~1.2.0@stable
- silverstripe/framework: ^4.9.0@stable
- silverstripe/mimevalidator: ~2.2.0@stable
Requires (Dev)
- phpunit/phpunit: ~8
This package is auto-updated.
Last update: 2024-11-03 16:09:53 UTC
README
A simple wrapper for Lifeboat PHP SDK
This wrapper provides access to 2 classes which your app can extend from
to make it easy to create Lifeboat Apps. It also loads
the APP_ID
and APP_SECRET
directly from your
environment variables.
Installation
You can install this module via Composer. Run the command
composer require lifeboat/silverstripe
Configuration
.env
LIFEBOAT_APP_ID='[[Your App ID goes here]]' LIFEBOAT_APP_SECRET='[[Your App Secret goes here]]'
Alternatively create a .yml
config
lifeboat.yml
--- Name: lifeboat_config After: - '#lifeboat_silverstripe_app' --- Lifeboat\Models\Site: APP_ID: "[[YOUR APP ID]]" APP_SECRET: "[[YOUR APP SECRET]]" ---
Helper Classes
Lifeboat\Models\Site
// Get the current active site object Lifeboat\Models\Site::curr();
This object will automatically store the user's active site and allows for automatic filtering of the objects so that you only show objects this user has access to.
Lifeboat\Controllers\AppController
class YourController extends Lifeboat\Controllers\AppController {}
By extending from the AppController
class
you'll ensure that anyone that interacts with your app
is authenticated and is using the correct site object
Lifeboat\Extensions\SiteObject
YourObject: extensions: - Lifeboat\Extensions\SiteObject
Make sure to add the SiteObject
extension to your
Data Models. This will add a Site
relationship
and automatically filter objects based on the currently
active site via augmentSQL
.