Download the PHP package chieftools/sdk without Composer
On this page you can find all versions of the php package chieftools/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chieftools/sdk
More information about chieftools/sdk
Files in chieftools/sdk
Package sdk
Short Description Base functionality and helpers used for building Chief Tools.
License MIT
Homepage https://chief.app
Informations about the package sdk
Chief Tools SDK
Base functionality and helpers used for building Chief Tools.
Keep in mind that this package is not meant to be used standalone, but as a base for building our own Chief Tools, this package is open-sourced for inspiration and to be used as a reference.
Configures
- Authentication through Account Chief (powered by Socialite)
- Configured Sentry client
- Lighthouse GraphQL with base schema and scalars
- Session protected endpoint
/api/graphql/web
- Session protected (GraphiQL) playground
/api/playground
- Access token protected endpoint
/api/graphql
(tokens managed by Account Chief)
- Session protected endpoint
- Basic API documentation pages for GraphQL endpoint
- Account pages to show profile information and preferences
- Team pages to show team information, preferences and billing
- Redirects to Chief Tools for
/contact
,/privacy
,/terms
- Account Chief webhook handler to be notified when user, team or tokens change
- Login event listener to update the
last_login
column on theusers
table - Health check queue job pinging
QUEUE_MONITOR_URL
every minute using the default queue (disabled whenQUEUE_MONITOR_URL
is empty or unset)
Provides
Middleware
ChiefTools\SDK\Middleware\AuthenticateChief
Validates a request comes from Chief Tools
Requiresservices.chief.webhook_secret
configuration to be set to a random stringChiefTools\SDK\Middleware\AutoAuthenticate
Uses both theapi
andweb
guard and sets the first that is authenticatedChiefTools\SDK\Middleware\ForceSecure
Make sure the request is overhttps://
ChiefTools\SDK\Middleware\MoveAccessTokenFromURLToHeader
Move the access token fromaccess_token
GET paramater to theAuthorization
headerChiefTools\SDK\Middleware\SecurityHeaders
Adds a default set of security headers, can be configured by settingchief.response.securityheaders
(array) in the app configChiefTools\SDK\Middleware\TrustProxiesOnVapor
Configuresfideloper/proxy
to be used on Laravel Vapor
Validation rules
ChiefTools\SDK\Rules\UUID
Valites the input value is a UUIDv4
Helpers
active($whitelist = null, $blacklist = null, $active = 'active', $inactive = '')
Get active state based on whitelist. Used to indicate active menu'stimezones(): array
Return an key-value list of all timezonesvalidate($fields, $rules): bool
Validate fields against rules. Examplevalidate($id, new \ChiefTools\SDK\Rules\UUID)
latest_ca_bundle_file_path(): string
Get the path to the most up-to-date CA bundle file, uses Certainty under the hood
Installation
Start with requiring the package:
Publish the configuration files and optionally the migrations:
Run the app migrations to create the users table:
Add the Chief service to the config/services.php
:
That's all, you should be able to authenticate against Account Chief.
GraphQL API
You will need to create a routes/graphql/schema.graphql
in your own project with the following contents:
Anything you want to add the the schema you can do thereafter, for example:
Keep in mind that the User
type is already provided so you will need to extend that if you want to append fields.
All versions of sdk with dependencies
guzzlehttp/guzzle Version ^7.5
laracasts/utilities Version ^3.2
laravel/framework Version ^11.44|^12.7
laravel/helpers Version ^1.5
laravel/socialite Version ^5.5
mll-lab/graphql-php-scalars Version ^6.1
nuwave/lighthouse Version ^6.47
pusher/pusher-php-server Version ^7.2
sentry/sentry Version ^4.3
sentry/sentry-laravel Version ^4.5
stayallive/laravel-eloquent-observable Version ^1.0
stayallive/laravel-eloquent-uuid Version ^1.0
stayallive/random-tokens Version ^1.0