2017 © Pedro Peláez
 

library laravel-codepen

A Codepen Package for Laravel 5

image

unicodeveloper/laravel-codepen

A Codepen Package for Laravel 5

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

laravel-codepen

Latest Stable Version License Build Status Total Downloads, (*1)

Laravel 5 Package to work with Codepen. Very easy to use. Offers the use of Facades and Dependency Injection, (*2)

Installation

PHP 5.5+ or HHVM 3.3+, and Composer are required., (*3)

First, pull in the package through Composer., (*4)

``` bash $ composer require unicodeveloper/laravel-codepen, (*5)


Another alternative is to simply add the following line to the require block of your `composer.json` file.

"unicodeveloper/laravel-codepen": "1.0.*", (*6)


Then run `composer install` or `composer update` to download it and have the autoloader updated. Add this to your providers array in `config/app.php` ```php // Laravel 5: config/app.php 'providers' => [ ... Unicodeveloper\Codepen\CodepenServiceProvider::class, ... ];

This package also comes with a facade, (*7)

// Laravel 5: config/app.php

'aliases' => [
    ...
    'Codepen' => Unicodeveloper\Codepen\Facades\Codepen::class,
    ...
]

Usage

CodepenManager

This is the class of most interest. It is bound to the ioc container as 'laravel-codepen' and can be accessed using the Facades\Codepen facade., (*8)

Facades\Codepen

This facade will dynamically pass static method calls to the 'laravel-codepen' object in the ioc container which by default is the CodepenManager class., (*9)

Examples

Here you can see an example of just how simple this package is to use., (*10)

use Unicodeveloper\Codepen\Facades\Codepen;
// or you can alias this in config/app.php like I mentioned initially above

Codepen::getMostPopularPens();
// returns an array containing 12 results of the most popular codepens

Codepen::getLatestPickedPens();
// returns an array containing 12 results of the latest picked codepens

Codepen::getRecentlyCreatedPens();
// returns an array containing 12 results of the most recently created codepens

Codepen::getProfile($username);
// returns an object containing the profile of a user . e.g $username is chriscoyier
{#169 ▼
  +"nicename": "Chris Coyier"
  +"username": "chriscoyier"
  +"avatar": "//s3-us-west-2.amazonaws.com/s.cdpn.io/3/profile/profile-512_22.jpg"
  +"location": "Milwaukee, WI"
  +"bio": "I'm kinda into this whole CodePen thing."
  +"pro": true
  +"followers": "6399"
  +"following": "1165"
  +"links": array:3 [▶]
}

Codepen::user('chriscoyier')->location;
// returns Milwaukee, WI

Codepen::user('chriscoyier')->nicename;
// returns Chris Coyier

Codepen::user('chriscoyier')->username;
// returns chriscoyier

Codepen::user('chriscoyier')->avatar;
// returns //s3-us-west-2.amazonaws.com/s.cdpn.io/3/profile/profile-512_22.jpg

Codepen::user('chriscoyier')->bio;
// returns I'm kinda into this whole CodePen thing.

Codepen::user('chriscoyier')->followers;
// returns 6399

Codepen::user('chriscoyier')->following;
// returns 1165

Codepen::getLovedPosts($username);
//  e.g sample $username is chriscoyier, returns an array of his most loved posts

Codepen::getPopularPosts($username);
// e.g sample $username is chriscoyier, returns an array of his most popular posts

Codepen::getPublishedPosts($username);
// e.g sample $username is chriscoyier, returns an array of his most published posts

Codepen::getLovedPens($username);
// e.g sample $username is chriscoyier, returns an array of his most loved pens

Codepen::getPopularPens($username);
// e.g sample $username is chriscoyier, returns an array of his most popular pens

Codepen::getPublicPens($username);
// e.g sample $username is chriscoyier, returns an array of his public pens

Codepen::getForkedPens($username);
// e.g sample $username is chriscoyier, returns an array of his most forked pens

Change log

Please see CHANGELOG for more information what has changed recently., (*11)

Testing

You can run the tests with:, (*12)

vendor/bin/phpunit run

Alternatively, you can run the tests like so:, (*13)

composer test

Contributing

Please see CONTRIBUTING for details., (*14)

Credits

License

The MIT License (MIT). Please see License File for more information., (*15)

Security

If you discover any security related issues, please email prosperotemuyiwa@gmail.com instead of using the issue tracker., (*16)

The Versions

09/11 2015

dev-master

9999999-dev https://twitter.com/unicodeveloper

A Codepen Package for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php laravel 5 package bridge unicodeveloper laravel-codepen codepen

09/11 2015

1.0.1

1.0.1.0 https://twitter.com/unicodeveloper

A Codepen Package for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php laravel 5 package bridge unicodeveloper laravel-codepen codepen

08/11 2015

1.0.0

1.0.0.0 https://twitter.com/unicodeveloper

A Codepen Package for Laravel 5

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel php laravel 5 package bridge unicodeveloper laravel-codepen codepen