Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Alejandro Celaya:
My first approach to Zend Expressive
Sep 14, 2015 @ 10:50:40

The team behind the Zend Framework recently released a microframework of sorts that makes use of middleware as its primary location for processing: Zend Expressive. In this post to his site Alejandro Celaya takes a "first approach" to this new framework and shares some of what he's discovered.

One of the trending topics in the PHP world nowadays is the one about microframeworks. It started some years ago with Slim and Silex, but recently it has been an explossion of new microframeworks. First, Slim's team announced the third version of its own framework, which implemented the psr-7 HTTP standard by taking advantage of the middleware concept. [...] Then, Laravel launched the Lumen project, which is another microframework based on Laravel components [and] Zend framework's team launched Zend Expressive, which is similar to Slim 3 in the fact that it works with middleware and psr-7, built on top of zend-stratigility and zend-diactoros.

He starts the post off answering two "why" questions: "why microframeworks" and "why Zend Expressive". He then gets into the technical details, comparing some of the basic route handling across the different microframework projects (with code examples). He shows how Expression allows the use of a service container as the main object instead of just defining routes (and what routers that's compatible with). He briefly covers some of the other piece of the Expression puzzle: template library support, the service container, error management and some other considerations to think about with evaluating the tool.

tagged: zendexpressive expressive microframework introduction overview comparison

Link: http://blog.alejandrocelaya.com/2015/09/12/my-first-approach-to-zend-expressive/

Matthew Setter:
Why Microframeworks Lead to Lean Applications
Sep 03, 2015 @ 10:17:35

Matthew Setter as a post on his site that suggests that microframeworks make for lean applications, such as one he recent built using the Slim framework.

Recently I built a new application using SlimPHP, a PHP microframework, instead of a full-stack framework, such as Symfony or Zend Framework 2. In this post, I start discussing how taking this approach has lead to a leaner application design. [...] Before I get too far along, I want to make one thing clear, I'm not bagging full-stack frameworks. [...] Technically, you don't need to bring in more than you need. However, often times, these frameworks still do have a lot of overhead which you may, typically, never need. [...] Whereas microframeworks, assuming they follow The MicroPHP Manifesto, especially SlimPHP, give you the minimum you need to start building a web application.

He goes on to talk about why he made the choice of Slim for his application and describes a bit about what the application does. He talks about some of his main needs when creating the site and how Slim matched up with most of them (with a little help from a few other packages). He included other libraries for YAML parsing, Markdown output formatting, caching and others to round out the application but Slim was at the heart of it. He ends the post by pointing out that taking this lightweight approach was a perfect fit for his project and that, while there were other choices, Slim fit his needs best.

tagged: lean application microframework slim slimframework packages

Link: http://www.matthewsetter.com/why-a-microframework-lead-to-lean-applications/

Rob Allen:
First beta of Slim Framework 3
Jul 03, 2015 @ 08:03:18

Rob Allen has a new post about the tagging of the first beta of Slim Framework v3, the popular PHP microframework's latest version. In it he details a few of the major changes and requests help testing.

Last night, I tagged beta 1 of Slim Framework 3! This is a significant upgrade to v2 with a number of changes that you can read on the Slim blog. For me, the two key features that I'm most excited about are: PSR-7 support, [...and a] dependency injection container with container-interop compliance. [...] There's lots of other changes and we believe we have kept to the key tenants of Slim, keeping it focussed as a micro-framework suitable for building any application that you want to build.

He includes everything you'll need to test this newly tagged release with the help of his skeleton application. He also links to the new documentation that's a work in progress to replace the current set of docs. You can find more information on the full list of changes over on the Slim blog.

tagged: slim microframework framework slim3 beta tagged testing documentation

Link: http://akrabat.com/first-beta-of-slim-framework-3/

Rob Allen:
Accessing services in Slim 3
Jun 23, 2015 @ 10:51:36

Rob Allen has a new post to his site today showing you how to access services in a Slim 3 application using container injection instead of the previous "getInstance" method.

One of the changes between Slim Framework 2 and 3 is that the application singleton has gone. [...] In general, you didn't need access to $app itself, but rather you wanted access to something that the app knows about, such as a database adapter, or the router for access to the urlFor method to create a URL to a route. With Slim 3, there is no getInstance() on App, so you need to inject the instances of whatever you need where ever you need them.

He shows you how to create a simple Slim dependency injection container (service locator?) and push two kinds of objects in for later reuse. He shows how to reference this container from inside of your routes in both the callable/closure and class contexts. He also includes an example of referencing the same container from inside middleware (again in both the closure and class contexts).

tagged: slim microframework framework slim3 service access container this

Link: http://akrabat.com/accessing-services-in-slim-3/

SitePoint PHP Blog:
Building a Micro Markdown API App with Lumen
May 12, 2015 @ 10:35:57

The SitePoint PHP blog has a new tutorial posted showing you how to create a small API service with Lumen, the recently released microframework from the creators of Laravel. Their example service takes in Markdown content and translates it to be returned as JSON.

If you’ve been using Laravel for a while, you know that it sometimes feels a little heavy for a small application or service. For that same purpose, Taylor, the creator of Laravel built Lumen. A small micro-framework built on top of Laravel Illuminate components, it doesn’t load all the components by default like Eloquent, Blade, Middleware, etc, remaining light as it boots up. We will explore all of that this short tutorial. [...] To illustrate a practical use case for the micro framework, we will be creating a Markdown parser API application where the user can submit a Markdown text and get back the parsed content as JSON. I will be using the league/commonmark package from the PHP League.

They walk you through the installation of a Lumen instance (via Composer) and how to build out the folder structure for things like resources, database configuration and views. They then include the code for the route and controller to take in the Markdown content and translate it out to HTML as a first step. Then they use the same functionality and return the HTML result as a JSON document. Also included is a simple few line call with Guzzle to the API to pass in a Markdown file and fetch the result.

tagged: tutorial markdown lumen microframework commonmark translate api microservice

Link: http://www.sitepoint.com/building-micro-markdown-api-app-lumen/

Propser Otemuyiwa:
Developing a Micro-Service with Lumen
May 07, 2015 @ 09:55:57

Propser Otemuyiwa has a quick new post to his site showing you how to make a micro-service with Lumen, the recently introduced microframework from the creators of Laravel.

I introduced Lumen to you all in my previous post. Today we’ll be creating a simple microservice with Lumen. [...] So, the idea is to build a microservice that showcases your Developer Evangelist status based on the number of public repos you have on Github. The assumption here is that the more publicly available repos you have on github, the more you support the idea of Open source..giving back to the community.

He walks you through the full process:

  • Creating the Lumen project
  • Serving up the new application
  • Enabling Eloquent and the .env handling
  • Adding a single index route

He then fills in the route handling with a bit of code to pull from GitHub and get the number of public repositories a user has and assigns them a "rank" based on that.

tagged: microservice microframework lumen tutorial github example introduction project

Link: http://prosperotemuyiwa.com/developing-a-micro-service-with-lumen/

Luciano Mammino:
Developing a web application with Lumen and MySql
Apr 27, 2015 @ 08:24:09

Luciano Mammino has a tutorial posted to his site showing you how to create a Lumen application that ties into a MySQL database from start to finish. It's a simple "display a famous quote" application, but it shows the full process you'll need to follow to hook it all together.

Lumen is a new Php micro-framework developed by Taylor Otwell, the same author of the famous Laravel framework. I wanted to give it a try and I am here to share my experimentations. I am not an expert of Lumen (yet), but I think one of the best characteristics of this framework is that it makes really really easy to bootstrap a new project. So to prove this, we will now build a fully functional app backed by a MySql database in less than 30 minutes. Are you ready to start?

His goal is a create a simple application that displays a quote, "randomized" based on the day. He shows you how to set up a new Lumen project, configure the database and create a migration to create the table in MySQL. He also includes the code for the data seeder and the main application routing (just two routes). Finally, he includes the output template and the CSS needed to make the end result look as expected.

tagged: lumen tutorial microframework mysql famous quote application

Link: http://loige.co/developing-a-web-application-with-lumen-and-mysql/

Slim Framework Blog:
Apr 17, 2015 @ 09:34:17

Josh Lockart, the lead developer and creator of the Slim framework, has responded to some questions and comments around the recently released Laravel microframework Lumen and how it relates to Slim and its own goals.

Lumen happened. It’s a shiny new micro-framework from Taylor Otwell, and it joins the Laravel family today. It looks to be a pretty nice framework, and it shares many of the same features and goals as Slim 3.0. I’m sure this raises a few question about Slim’s future roadmap. [...] Is there overlap between Slim and Lumen? Of course. They both have similar goals and solve similar problems. There are also differences.

He talks about some of the current work being done on version 3.0 of Slim, the PSR-7 support it offers and some of the differences between Slim and Lumen. He points out two main ones: that Slim has fewer dependencies and that it is a supporter of the PSR-7 HTTP interoperability standard. Josh talks about why you might choose Lumen over Slim and that, in the end, he welcomes alternative microframeworks and challenges the Slim community to help consistently improve Slim and its place in the community.

tagged: slimframework slim lumen respond opinion framework laravel microframework

Link: http://www.slimframework.com/2015/04/14/lumen.html

Laravel News:
Announcing Lumen
Apr 15, 2015 @ 10:23:12

The creators of the Laravel framework (Taylor Otwell and crew) have just released a new micro-framework based on some of the ideals and components that power the full version of Laravel - Lumen. In this post to the Laravel News site they talk some about the framework and what it has to offer.

Lumen is a brand new PHP framework from Taylor Otwell designed for building lightning fast micro-services and API’s. When speed is a necessity, Lumen should be your first choice.

One of the neat things about the framework is you can still use all the Laravel features you love like Eloquent, caching, queues, validation, routing, middleware, and the powerful Laravel service container. Plus if you start your project with Lumen and eventually need even more power, moving to the full featured Laravel is a simple process.

They interviewed Taylor about the framework answering:

  • What made you decide to create Lumen?
  • Where did the name Lumen come from?
  • Being able to upgrade right into Laravel is huge. Was this the plan from the beginning?
  • How were you able to get the framework so fast, while still keeping so many great features?

Check out the full post for the answers and more details about the framework itself.

tagged: lumen announcement taylorotwell interview microframework laravel

Link: https://laravel-news.com/2015/04/lumen/

Matt Stauffer:
Introducing Lumen from Laravel
Apr 14, 2015 @ 13:34:50

Taylor Otwell, lead developer of the Laravel framework, released a new micro-framework recently based on some of the same components and ideas behind the Laravel framework called Lumen. In this new post from Matt Stauffer you'll get a brief introduction to this new framework and how to get your own instance up and running.

Lumen is a new project from Laravel creator Taylor Otwell. It's a "micro-framework", meaning it's a smaller, faster, leaner version of a full web application framework. PHP has two other popular micro-frameworks, Slim and Silex. Lumen has the same foundation as Laravel, and many of the same components. But Lumen is built for microservices, not so much for user-facing applications (although it can be used for anything.) As such, frontend niceties like Bootstrap and Elixir and the authentication bootstrap and sessions don't come enabled out of the box, and there's less flexibility for extending and changing the bootstrap files.

Matt shows how to get a copy of the framework installed and how to enable some common features. He includes examples of route definitions, API callers and using the simple caching mechanism.

tagged: lumen laravel microframework introduction install tutorial

Link: https://mattstauffer.co/blog/introducing-lumen-from-laravel