2017 © Pedro Peláez
 

library cloudcms-laravel

Package wrapping the cloudcms php sdk for laravel

image

idealley/cloudcms-laravel

Package wrapping the cloudcms php sdk for laravel

  • Monday, March 6, 2017
  • by Idealley
  • Repository
  • 1 Watchers
  • 1 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Laravel Cloud CMS Wrapper

Here is the PhP agnostic SDK, (*1)

Every thing is still very experimental and subject to CHANGE

How to install:

composer require idealley/cloudcms-laravel, (*2)

Publish the config with the command, (*3)

php artisan vendor:publish, (*4)

This will let you change few settings in the app/config folder., (*5)

How to use

CC is a Laravel Facade., (*6)

to use it add use CC; at the top of your file., (*7)

You can get a children of a node like this (think category or list of blogs), (*8)

    $catnode = 'o:9a8195e6286a4f7b40ae';

    $nodes = CC::nodes()
            ->listChildren($catnode)
            ->addParams(['full' => 'true'])
            ->get(); 

Or a single node (for now we are getting it from a special slug field) like this:, (*9)

    $node = CC::nodes()
                ->find($slug)
                ->addParams(['full' => 'true'])   
                ->get();

You can chain paramas, (*10)

    $node = CC::nodes()
                ->find($slug)
                ->addParams(['full' => 'true']) 
                ->addParams(['metadata' => 'true'])   
                ->get();           

or pass them in a single array, (*11)

                ->addParams(['full' => 'true', 'metadata' => 'true']) 

You can get an image like this, (*12)

    $path = 'Samples/Catalog/Products/';            
    $img = CC::nodes()
                ->getImage($node['rows'][0]['_qname'])
                ->addParams(['name' => $node['rows'][0]['_features']['f:filename']['filename']])
                ->addParams(['size' => '400'])
                ->set();

There are many more methods you can use, check 'Node' class in the cloudcms-sdk to find everything that is available. Each method is documented with working query examples., (*13)

You can chain any params as per the documentation, (*14)

Do not forget to add these values in your .env file, (*15)

    CC_CLIENT_KEY=
    CC_CLIENT_SECRET=
    CC_USERNAME=
    CC_PASSWORD= 
    CC_CLIENT_KEY=
    CC_TOKEN_STORAGE_PATH=/storage/token
    CC_DEPLOYMENT_URL=                                       

The Versions

06/03 2017

dev-master

9999999-dev

Package wrapping the cloudcms php sdk for laravel

  Sources   Download

MIT

The Requires

 

by Samuel Pouyt

05/10 2016

v1.0.1

1.0.1.0

Package wrapping the cloudcms php sdk for laravel

  Sources   Download

MIT

The Requires

 

by Samuel Pouyt

19/07 2016

v1.0.0

1.0.0.0

Package wrapping the cloudcms php sdk for laravel

  Sources   Download

MIT

The Requires

 

by Samuel Pouyt