Download the PHP package area17/twill-api without Composer

On this page you can find all versions of the php package area17/twill-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package twill-api

Twill API

Provide a read-only API to Twill models and entities along with base structure to create your own JSON:API compliant REST API. This package is based on and requires the excellent Laravel JSON:API package.

Installation

This package needs a Laravel project with Twill already set up.

Install Laravel JSON:API

Follow the steps outlined in the Laravel JSON:API documentation.

Update config/jsonapi.php with the namespace you would like to use.

Install Twill API

Publish config file config/twill-api.php and migrations. Apply migrations.

Create you base Server.php class

Update config/jsonapi.php servers key with your newly created Server class.

If you want to make you API public (which is convenient early in development), you can update the authorisable method in your Server class.

Add API middlewares you the api group in app/Http/Kernel.php. See below for a list of the available middlewares.

Middlewares

Middleware to set locale

To query the API by adding the locale query string to the url. For example https://example.com/api/v1/books?locale=fr will give you the results available in the French (fr) locale.

Middleware to remove unpublished content

from browser fileds and features.

Traits

Whenever your models has media or files attached to them, you must add the traits provided in this package in order to expose a relationship to the pivot models for each (by default it is the mediables and fileables tables).

If your model also have children blocks (saved through repeater inside a block), you must add the HasChildBlocks for the API to respect the parent/child relation in the API response.

Create a resource schema and API route

To create a basic schema for a new resource (model), use the artisan command twill-api:schema. Pass the name of the Twill module as the argument.

This command will create app/TwillApi/V1/Snippets/SnippetSchema.php. The command will display a few instructions to register the new schema with the API server and how to declare the endpoint in you routes/api.php.

For what is available from there, consult the Laravel JSON:API documentaiton under the Schemas section.

Your new endpoint should now be available at http://localhost/api/v1/snippets.

Resources

Endpoints

This package provides these endpoints along with their schema:

Blocks

(to do)

Browser fields (related items)

(to do)

Features

(to do)

Use API tokens to show unpublished content

(to do)


All versions of twill-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
area17/twill Version ^3.0|3.x-dev
illuminate/support Version ^10.13
laravel-json-api/laravel Version ^3.0
spatie/laravel-package-tools Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package area17/twill-api contains the following files

Loading the files please wait ....