Download the PHP package sensiolabs-de/storyblok-api without Composer

On this page you can find all versions of the php package sensiolabs-de/storyblok-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 storyblok-api

storyblok-api

Branch PHP Code Coverage
master PHP codecov

Symfony

Use the symfony bundle sensiolabs-de/storyblok-bundle to integrate this library into your Symfony application.

Usage

Installation

Setup

Spaces

In your code you should type-hint to SensioLabs\Storyblok\Api\SpacesApiInterface

Get the current space

Returns the space associated with the current token.

Stories

In your code you should type-hint to SensioLabs\Storyblok\Api\StoriesApiInterface

Get all available stories

Fetch by Version (draft, published)

Global

Method Call

Pagination

Sorting

Filtering

Available filters

AllInArrayFilter.php

Example:

AnyInArrayFilter.php

Example:

GreaterThanDateFilter.php

Example:

LessThanDateFilter.php

Example:

GreaterThanFloatFilter.php

Example:

LessThanFloatFilter.php

Example:

GreaterThanIntFilter.php

Example:

LessThanIntFilter.php

Example:

InFilter.php

Example:

NotInFilter.php

Example:

IsFilter.php

Example:

LikeFilter.php

Example:

NotLikeFilter.php

Example:

OrFilter.php

Example:

Get all available stories by Content Type (string)

Get by uuid (SensioLabs\Storyblok\Api\Domain\Value\Uuid)

Get by slug (string)

Get by id (SensioLabs\Storyblok\Api\Domain\Value\Id)

Links

In your code you should type-hint to SensioLabs\Storyblok\Api\LinksApiInterface

Get all available links

Pagination

Get by parent (SensioLabs\Storyblok\Api\Domain\Value\Id)

Get all root links

Datasource

In your code you should type-hint to SensioLabs\Storyblok\Api\DatasourceApiInterface

Get by name (string)

If it has more than one dimension, you can get the entries by

Tags

In your code you should type-hint to SensioLabs\Storyblok\Api\TagsApiInterface

Get all available tags

Assets

To use the assets API you have to configure the Assets client.

DX Enhancement through Abstract Collections

To improve developer experience (DX), especially when working with content types like stories, the following abstract class is provided to manage collections of specific content types. This class simplifies data handling and ensures type safety while dealing with large amounts of content from Storyblok.

Abstract ContentTypeCollection Class

The ContentTypeCollection class provides a structured way to work with Storyblok content types. It makes managing pagination, filtering, and sorting more intuitive and reusable, saving time and reducing boilerplate code.

Benefits of Using the Abstract Collection:

  1. Simplified Data Handling: Instead of dealing with raw arrays of stories, this abstract class helps you manage collections of content types, like blog posts or articles, in an organized manner. It abstracts away the repetitive work of pagination and mapping response data to objects.
  2. Enhanced Readability: Using a well-structured collection class makes the code easier to read and maintain. Instead of handling pagination and raw data structures in controllers or services, you simply instantiate the collection and let it handle the data.
  3. Reusability: The class is flexible and reusable across different content types. Once implemented, you can easily create new collections for other Storyblok content types with minimal extra code.
  4. Pagination and Metadata Management: The collection class comes with built-in properties for pagination and metadata (e.g., total items, current page, etc.), making it much easier to manage paginated data efficiently.

Example Usage with a Collection

Here is an example of how to use the ContentTypeCollection to manage blog posts in your Symfony project:


All versions of storyblok-api with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
oskarstark/enum-helper Version ^1.5
oskarstark/trimmed-non-empty-string Version ^1.1
psr/log Version ^3.0
symfony/cache Version ^7.0
symfony/cache-contracts Version ^3.5
symfony/http-client Version ^6.0 || ^7.0
thecodingmachine/safe Version ^2.0
webmozart/assert 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 sensiolabs-de/storyblok-api contains the following files

Loading the files please wait ....