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

Nicolas Widart:
Writing modular applications with laravel-modules
Jul 13, 2016 @ 11:57:39

In a new post to his site Nicolas Widart introduces you to the idea of building Laravel applications a bit differently than you may normally: in a more modular structure. This structure makes use of this package to make it happen.

Let me start by saying Laravel is an amazing framework. However when it comes to writing more complex and bigger applications, I find the default structure laravel comes with cumbersome and not ideal.

The way the default laravel installation comes with is basically all the application logic inside an app/ folder. This works, but I would not suggest going this route. [...] This is what being modular is trying to resolve. You split of the business logic into different parts, which belongs together. If you're into Domain Driven Design, you can consider a module an aggregate.

Each module has its own resources (routes, models, views, etc) combined into a single "drop-in" structure. He provides an example of this structure and compares it to the more traditional Laravel "all-app" structure. The package he links to makes this modular structure simpler and points out that this system is what the AsgardCMS already uses behind the scenes.

tagged: modular application laravel tutorial example package asgardcms

Link: https://nicolaswidart.com/blog/writing-modular-applications-with-laravel-modules

Stefan Koopmanschap:
The Speaker Package
Jul 12, 2016 @ 13:38:36

Stefan Koopmanschap has continued his look at conferences and sharing some of his own personal views around them and, mostly, the Call for Papers process. In his new post he focuses on the Speaker Package, a nicety that's often provided by the conference to help the speaker come to and stay at the event.

The speaker package is the term used for the package of reimbursements and other advantages you have as a speaker. This may (or may not) include a free ticket to the conference, travel and/or hotel reimbursements, a speakers dinner and some other things.

When submitting to a conference, it is important to realize what the speaker package consists of. [...] I made the mistake once of making assumptions about the speaker package (in this case: I assumed travel was being reimbursed) when submitting proposals to a conference. I got accepted, but then found out my flight was not covered by the conference. Because of that, I had to cancel that conference.

He makes the recommendation that, if the speaker package seems unclear by the documentation on the site, you ask the organizers for the information instead of assuming. He also shares one of his own personal rules about submitting - not putting in any submissions if the conference doesn't have a speaker reimbursement package. He does this because he sees the time he puts in to prepare and present as valuable and the package is a conference's way of saying that work is appreciated.

tagged: conference opinion speaker package compensation submission callforpapers

Link: http://leftontheweb.com/blog/2016/06/30/The-Speaker-Package/

Freek Van der Herten:
A package to log activity in a Laravel app
Jun 30, 2016 @ 09:46:17

In a new post to his site Freek Van der Herten shares information about a logging package they've developed for Laravel-based applications to make activity logging simpler throughout the app: laravel-activitylog.

n your apps there’s probably a lot going on. Users log in and out, they create, update and delete content, mails get sent and so on. For an administrator of an app these events provide useful insights. In almost every project we make at Spatie we log these events and show them in the admin-section of our site. [...] We made a new package called laravel-activitylog that makes logging activities in a Laravel app a cinch. In this blogpost I’d like to walk you through it.

He then goes through the basics of using the library, complete with code examples:

  • simple activity logging with messaging
  • providing the "acted on" object information
  • logging the information about who the actor was

There's also a section with details on automatic model logging, making it easier to see the changes on you data without having to log each one individually. He also shows you how to use multiple logs, providing a method to narrow down log records by type.

tagged: laravel application logging package example introduction model

Link: https://murze.be/2016/06/package-log-activity-laravel-app/

Laravel News:
Laravel and Elasticsearch
Jun 16, 2016 @ 09:08:22

The Laravel News site has posted a quick guide for those wanting to use ElasticSearch along with their Laravel applications. The post lists several libraries and resources that can help you get started quickly.

Elasticsearch allows you to search & analyze data in real time. Even though it’s extremely powerful working with delta’s and querying data is not that simple.

If you are using Laravel here is a list of packages and tutorials to help you easily integrate this into your app.

The packages include Plastic and Spatie Searchindex while the tutorials cover things like installing ElasticSearch on Homestead and integrating it with your application.

tagged: laravel elasticsearch integration tutorial library package links

Link: https://laravel-news.com/2016/06/laravel-and-elasticsearch/

Freek Van der Herten:
Getting package statistics from Packagist
May 23, 2016 @ 10:18:07

In a post to his site Freek Van der Herten shows you how to gather information from the Packagist website about the number of times that your packages have been downloaded.

At my work I’m currently creating a new dashboard. That’s a fancy term for an html page sprinkled with some Vue magic that will be displayed on tv screen at the wall of our office. I won’t say much about the dashboard itself on this post, but I’ll make sure to write something on that in the near future.

One of the things I want to display on our dashboard is how many times our packages get downloaded (yeah it’s a vanity project, sorry about that :-)). To make this real easy our intern Jolita and I cooked up a new package called packagist-api. It uses the packagist api to fetch data about published packages.

They include an example of the package in use, fetching the list of packages for the "spatie" vendor and getting the details by package name. The results include more information than just the download count as well (including current version, maintainers and the basic description). The post ends with an example of filtering out the downloads counts and putting them into a collection for later use.

tagged: package statistics packagist library results tutorial

Link: https://murze.be/2016/05/getting-package-statistics-packagist/

Laravel Daily:
Releasing Laravel Packages: Good, Bad and Ugly [VIDEO]
May 05, 2016 @ 10:43:46

In this new post to the Laravel Daily site Povilas Korop shares the second episode of his video podcast "Laravel Business" and talks about releasing Laravel packages.

Here’s the 2nd episode of my new Laravel Business video show where once a week I share the thoughts about Laravel-related work from the business perspective, as I’m transitioning from being a developer to being an owner of a small team.

Today I talk about packages – is it worth releasing Laravel packages? What are pros and cons? And can you earn money on it?

You can watch the episode either using the in-page player or directly over on YouTube.

tagged: laravelbusiness podcast video release package good bad ugly

Link: http://laraveldaily.com/releasing-laravel-packages-good-bad-and-ugly-video/

Phillip Shipley:
Docker makes upgrading to PHP7 easy
Apr 25, 2016 @ 11:13:07

In this post to his site Phillip Shipley talks about Docker and how using it for your PHP deployments can make it much easier to upgrade to PHP 7.

Last year at php[tek] 2015 during the hack time I messed around and created a Docker image to run and test PHP7. It was surprisingly easy and I quickly learned that the app I was working on at the time ran fine in PHP7, good deal. So since then I’ve been awaiting the general availability release of PHP7 to move forward with upgrading my apps.

The main thing holding me back was I just didn’t want to maintain an image based on compiling from source. Not that it’s a problem, it just didn’t feel as clean and simple as using supported packages.

He points out that Ubuntu 16.04 was released and that does now have PHP 7 as a standard package so he's happily upgrading. He gets into a bit of detail about how upgrade process and some of the smaller issue he faced along the way. He also includes the update to his Dockerfile he made to change to PHP 7 (only a few characters) to rebuild with PHP 7.0.4.

tagged: upgrade php7 docker ubuntu package official release

Link: http://www.phillipshipley.com/2016/04/docker-makes-upgrading-to-php7-easy/

SitePoint PHP Blog:
Sourcehunt: Cron Management, Hackathon Starters, PHP-GUI…
Apr 22, 2016 @ 10:40:55

The SitePoint PHP blog has posted the latest edition of their Sourcehunt spotlight. The Sourcehunt posts gather together some notable packages discovered over the last month and bring them to the community.

Packages and tools included in this latest post are:

There's several others mentioned as well including an ORM, a command line Twitter client and a language editor for Laravel. Be sure to check out the post for the full list.

tagged: sourcehunt package library featured project

Link: http://www.sitepoint.com/sourcehunt-cron-management-hackathon-starters-php-gui/

Jordi Boggiano:
Common files in PHP packages
Apr 21, 2016 @ 09:29:15

Jordi Boggiano has a new post to his site today sharing some interesting PHP package statistics he gathered as a part of the metadata in the Composer/Packagist ecosystem.

This one started in a peculiar way. Paul M. Jones announced a new version of his Producer tool, I had a look at it and saw that it recommended having a changelog called CHANGES.md by default. [...] My first thought was to report an issue asking to change the default, but then I thought it's Paul, he will not just take my word for it, he will want hard facts. So here I am two days later. I queried GitHub's API for the file listing (only the root directory) of all PHP packages listed on packagist.org. What this let me do is look at what files are commonly present (and not), which is quite interesting to get a picture of the whole ecosystem.

He queried about 79,000 packages and found some interesting patterns in the results. These included findings like:

  • 8% have a DependencyInjection/ directory, which I believe indicates Symfony bundles
  • 3.6% have a examples/ and 3.5% a docs/ directory
  • 49% have some file or directory indicating the presence of tests (phpunit.xml & co)
  • 14% have committed their composer.lock
  • 8% show a presence of some code quality/style CI (scrutinizer, codeclimate, styleci)

There's some other interesting statistics in the post around license files, changelogs and CLI binaries too. He's also posted the full data set for anyone interested in running some of their own statistics on the results.

tagged: package statistics packagist composer data results summary

Link: https://seld.be/notes/common-files-in-php-packages

Alejandro Celaya:
Improving ZendServiceManager workflow with annotations
Apr 11, 2016 @ 10:19:57

In a post to his site Alejandro Celaya shows you how to make life easier when using the ZendServiceManager with the help of annotations and a package he's developed to make it all work together.

Everyone who regularly visits my blog knows that I'm a complete fan of the ZendServiceManager component. It is always my choice to deal with dependency injection in any kind of project, more now that v3 has been released, which is faster and has a better public API.

The workflow while working with the ServiceManager is usually the same. You create a factory or abstract factory that creates a service and then you register that service into the ServiceManager itself. Of course you have to optimize your code, and you should try to reuse the same factories whenever possible, and try not to abuse of abstract factories and initializers.

He points out the main problem with using services like this in a larger application, namely that you can end up with a large amount of them, making them difficult to manage (and find problems with). He proposed solution uses this library to minimize the amount of code needed buy injecting dependencies into the service based on "inject" annotations. He includes an example of this functionality in action and includes a few things to keep in mind using the package (like the slower parsing of the annotations some limitations it currently has).

tagged: zend servicemanager component services workflow annotations inject tutorial library package

Link: http://blog.alejandrocelaya.com/2016/04/09/improving-zend-service-manager-workflow-with-annotations/