5 COMMENTs
PHP
Bruno Skvorc, Jun 28

Sourcehunt: PHP7-Only Alternative to Laravel, HPKP, and More

This sourcehunt features a PHP-7 only alternative to Laravel, input validation, HPKP, strict PHP object signatures, and more.
11 COMMENTs
PHP
Bruno Skvorc, Jun 27

Can Symfony Apps Be Fast on Vagrant? Let's Check with SuluCMS!

In this tutorial, we go through some effective performance hacks for developing Symfony apps on Vagrant virtual machines
9 COMMENTs
PHP
Daniel Sipos, Jun 20

Your Own Custom Annotations - More than Just Comments!

Danny teaches you how to build Doctrine-style PHP annotations for your own custom projects!
17 COMMENTs
PHP
Francesco Malatesta, Jun 13

Laravel Doctrine - Best of Both Worlds?

Francesco introduces Laravel Doctrine, and builds a sample app with it - come learn about this powerful ORM + Framework mix!
8 COMMENTs
PHP
Christopher Pitt, Jun 03

Hacking the Fitbit - Emulating a Pager for Twitter DMs!

Chris makes his cheap Fitbit vibrate on new Twitter DMs - emulated pager AND a silent wake-up alarm? WIN!
PHP
Bruno Skvorc, May 30

Sourcehunt: Conferences, Oauth2 in Slim, Static Analyzers, Etc.

Another sourcehunt is here! This time, we're featuring conference apps, personal project managers, oauth2 helpers, and more!
6 COMMENTs
PHP
Scott Molinari, May 18

Benchmarking: Can AppServer Beat Symfony's Performance?

Scott revisits Appserver and benchmarks it against Symfony to dispel the rumors of bas performance. Does he succeed? Tune in to find out!
2 COMMENTs
PHP
Wern Ancheta, May 13

We're Building a Marvel Catalog Reader! Avengers, Assemble!

In this tutorial, we're going to take a look at the Marvel API, a tool provided by Marvel for developers to get access to the 70-plus years of Marvel comics data.

Marvel logo

First, we'll walk through the steps in which one can acquire the keys needed to make requests to the API. Then, we'll look at the tools we can use to test out the API. Finally, we're going to build a website that uses the API.

Signing Up

The first thing we need to do is go to the Marvel Developer Website and click the Get a Key link. We'll then be provided with the public and private key which we can use to perform requests to the API. If you plan to use the project in production, you can also add your website's domain name to the list of authorized referrers. This provides a security layer in case you accidentally push your public and private keys to Github.

Important Notes Regarding the Use of the API

For limits and rules, please see the attribution, linking and rate limits page of their documentation. Also be sure to read the Marvel API Terms of Use if you're planning to use the API in production. I've summarized it below:

  • Beware of the API rate limit. At the time of writing of this tutorial the rate limit is 3000 calls per day. That's applicable to all the endpoints.
  • Always attribute Marvel as the source when displaying API data and images. Marvel recommends the use of this text: Data provided by Marvel. © 2016 Marvel.

Playing with the API

The API comes with an interactive documentation which allows you to easily test all the available API endpoints.

There's information on the data one can expect:

expected data

... text fields to specify the different parameters to be submitted for the request:

parameters

... error status codes:

error codes

... the request URL, response body, response code and the response headers:

request and response

Do note that the request URL won't actually return anything if you access it outside of the API testing tool. This is because it lacks the required parameters for the request. At the bare minimum, you'll have to supply the public key, the current unix timestamp, and an md5 hash of the timestamp, and private and public key combined.

<?php
$ts = time();
$public_key = 'your public key';
$private_key = 'your private key';
$hash = md5($ts . $private_key . $public_key);

Once you have those, only then can you perform a request to the API:

<?php
$query_params = [
    'apikey' => $public_key,
    'ts' => $ts,
    'hash' => $hash
];

//convert array into query parameters
$query = http_build_query($query_params);

//make the request
$response = file_get_contents('http://gateway.marvel.com/v1/public/comics?' . $query);

//convert the json string to an array
$response_data = json_decode($response, true);

We'll take a look at this in more detail when we get to the section where we start making requests for the app that we'll be building.

15 COMMENTs
PHP
Christopher Pitt, Apr 29

Starting a Business with Laravel Spark

Chris Pitt goes from zero to hero in a post detailing the process of building an actual business app from scratch with Laravel Spark!
7 COMMENTs
PHP
Wern Ancheta, Apr 05

PredictionIO and Lumen: Building a Movie Recommendation App

Wern continues the movie prediction app building process, this time nelisting the full power of Lumen, ElasticSearch, and PredictionIO
1 COMMENT
PHP
Bruno Skvorc, Mar 21

Sourcehunt March 2016: PHP in Rust, Pathfinding, Eve Online

This sourcehunt features a no-framework framework, PHP running in Rust, a new microframework, pathfinding in PHP, and more
7 COMMENTs
PHP
Wern Ancheta, Feb 29

Building a Hacker News Reader with Lumen

Wern Ancheta builds a Hacker News reader with a local cache from nothing with the Lumen microframework!
PHP
Bruno Skvorc, Feb 26

Sourcehunt #4 - Reflection, Authorization, Crons, and more

The newest edition of sourcehunt presents 6 more promising packages that might find a home in your project one day. Help them grow by contributing!
10 COMMENTs
PHP
Francesco Malatesta, Feb 19

How to Consume Laravel API with AngularJS

Francesco builds an AngularJS app to consume a previously built Laravel API application for making book wishlists. JSON web token authentication in action!
65 COMMENTs
PHP
Francesco Malatesta, Feb 17

How to Build an API-Only JWT-Powered Laravel App

Francesco builds an entire API-only application with the Laravel API Boilerplate project (JWT edition) for creating and editing book wishlists!
3 COMMENTs
PHP
Younes Rafie, Feb 01

Building OctoberCMS Form Field Widgets like a Pro

Younes Rafie looks at building awesome OctoberCMS form field widgets for deeply customized inputs and making OctoberCMS a true business-worthy CMS
6 COMMENTs
PHP
Scott Molinari, Jan 29

Appserver - Server Configuration, Dir Structure and Threads

Scott revisits Appserver and teaches you how to set up an example application with a custom virtual server. Your apps have never been this fast!
18 COMMENTs
PHP
Younes Rafie, Jan 27

OctoberCMS CRUD - Building a Team/Project Management Plugin

Younes Rafie uses OctoberCMS to build project and team management functionality into it, creating a fantastic app in a matter of minutes!
5 COMMENTs
PHP
Younes Rafie, Jan 15

Can PHP Be Even Faster? Light-Speed with the Blink Framework

Younes writes an entire Notejam app from scratch in this in-depth tutorial and analysis of the high-speed Blink framework
6 COMMENTs
PHP
Wern Ancheta, Nov 25

Liking, Watchlisting and Uploading through Vimeo's API

Wern continues where he left off in the last part, and implements liking, watchlisting and uploading of videos into his Slim application!
1 COMMENT
PHP
Wern Ancheta, Nov 23

Building a Basic Video Search App with Vimeo's API and Slim

Wern goes through the process of building a sample video search application consuming Vimeo's API, using the Slim framework. Don't change the channel!
7 COMMENTs
PHP
Shameer C, Nov 16

Basic User Management in Symfony2 with FOSUserBundle

Shameer quickly explains the gargantuan user management plugin for Symfony2: FOSUserBundle. Learn how to register, log in, and more!
11 COMMENTs
PHP
Reza Lavaryan, Nov 11

Meet Elixir, the Laravel Way of Compiling Assets

Reza goes through Elixir, a Laravel addon for front-end asset management. Compilation, minification, optimization, versioning and more - check it out!
22 COMMENTs
PHP
Reza Lavaryan, Nov 04

How Laravel Facades Work and How to Use Them Elsewhere

M. Reza explains how Laravel's facades work and shows you how to reimplement them in any non-Laravel project! Facades in Silex? Yes please!