Download the PHP package incraigulous/contentful-laravel without Composer

On this page you can find all versions of the php package incraigulous/contentful-laravel. 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 contentful-laravel

Latest Stable Version Total Downloads Latest Unstable Version Daily Downloads

DEPRECATED. Use Contentful's official PHP SDK.

Laravel Contentful SDK and Toolkit

A Contentful SDK and suite of tools for Laravel. Includes facades, a base repository, out-of-the-box caching and cache management, webhook creation by artisan command and more.

This is a Laravel package.

Looking for the framework agnostic PHP SDK?

Click Here for my Contentful PHP SDK used by this package.

New to Contentful? Contentful is an API driven CMS. Check out their website and API documentation.

Installation

Install via composer by running:

``

Update composer:

``

Next, add the following to the service providers array in config/app.php:

``

Configuration

Publish the config file:

``

This will add contentful.php to your /config folder.

Configuration Options

Key Name Description
space Contentful API Space Get this from the Contentful api panel
token Contentful API Token Get this from the Contentful api panel
oauthToken Contentful oAuth Token Needed for management SDK only
cacheTag Cache Tag To make sure we can target and clear only Contentful items
cacheTime Cache Time In minutes
WebhookUrlBase Webhook URL Base The default URL base to use for webhooks generated by artisan command*
WebhookUrlSuffix Webhook URL Suffix Will be appended to the webhook URL base

*In addition to URLs, WebhookUrlBase also takes keywords for custom URL generation. You may specify laravel to generate the URL from the app:url configuration setting or aws to generate the URL based on the AWS public host name.

Obtaining your oAuth token

Instructions for generating an oAuth token can be found in Contentful's Management API documentation. If you are getting your key dynamically, you could create your own Facade for the Management SDK and load it there.

How to use it

Using the SDK

Adding the service provider will make two facades available:

Contentful: The content delivery SDK
ContentfulManagement: The management SDK

Example calls using the content delivery SDK

The following call would get the first 10 entries for a content type with the word campus in the title.

``

The following call would get the first 5 assets with a file size greater than or equal to 350000 bites.

``

Example calls using the management SDK

Creating a new content type:

``

Updating a content type

``

Click Here for the full SDK documentation.

Caching

All GET request results from the content delivery SDK are cached by default out of the box. GET request results from the management SDK are not cached to avoid update version conflicts.

Clearing your Contentful cache via webhook

You must have have provided your oAuth key in your contentful.php configuration file to create webhooks. To create a new webhook for the cacher to listen for use the Artisan command:

``

This will create a webhook in Contentful that will post to your /contentful/flush route on any content updates. The package provides that route for you automatically and will flush Contentful items from your cache any time that route is posted to.

Here's a trick: The /contentful/flush route takes get or post, so you can clear your cache anytime by going to /contentful/flush in your browser.

What if you want to specify a custom webhook URL? Easy:

``

Note: Caching only works if your using the Redis and Memcached cache drivers.

Overriding CSRF Protection

Laravel comes with cross site forgery protection, so you'll have to override it for the /contentful/flush route in order for the webhook to post to your site successfully. Here's a guide on how to do that.

Listening for webhooks

If you autoscale your servers, you may need the ability to automatically create a webhook when a server is created and remove it when the server shuts down. You can do this by running the following command via Supervisor.

``

Contributing

See a typo or a bug? Make a pull request.
What a new feature? Make a pull request.
Want a new feature and don't know how to build it? You can always ask, I might be game if I think it's a good enough idea.


All versions of contentful-laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/support Version ~5.0
incraigulous/contentful-sdk Version 0.0.*
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 incraigulous/contentful-laravel contains the following files

Loading the files please wait ....