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

Deploy PHP Web Applications Using Laravel Forge
Mar 20, 2018 @ 11:09:46

The TutsPlus.com site has posted a new tutorial showing you how to make use of the Laravel Forge service to deploy your PHP applications. Laravel Forge provides the configuration and automation tools to deploy your applications to servers on your own accounts (like DigitalOcean or AWS).

Developers love to automate things—for every process between development and production, they are keen to have a script that makes their workflow easier. This is also the case with deployment. The process of pushing the final build and deploying the app should be as easy as pressing a Deploy now button, but that is not what happens most of the time.

[...] Don't let the Laravel brand name mislead you. Apart from Laravel, you can use the service to host WordPress, Symphony, Statamic, or any other web project as long as it's PHP. Personally, I like Laravel Forge for its simplicity and ease of getting used to.

In this tutorial, I am going to take you through the steps to hook Laravel Forge with AWS and explore what it has to offer.

The tutorial starts with an overview of the service and what kind of setup and configuration the resulting servers have (by default). It then covers the various configuration options available and walks you through the process of setting it up with your AWS account. It also includes details about the server management system Forge provides, site management, SSH key addition and PHP/MySQL configuration. A few other helpful hints are also tossed in at the end covering task scheduling, daemons, monitoring and network/firewall configuration.

tagged: application deployment laravelforge laravel tutorial aws introduction

Link: https://code.tutsplus.com/tutorials/deploy-php-web-application-using-laravel-forge--cms-30329

Exakat Blog:
Largest PHP applications (2018)
Mar 19, 2018 @ 11:35:46

On the Exakat blog there's a new post that includes the details of the largest PHP applications currently available (and popular) based on their own scanning of Open Source Projects.

When testing the exakat static analysis engine, I need to run it on real code. Open Source projects are a real blessing there, since they come in different shapes and stripes. [...] Nowadays, code bases tends to be smaller, compared to more ancient applications. Components are the norm, and they impact both the development of the application, and its extension.

[...] For this survey, we collected 1885 Open Source applications, and counted only their tokens. Tokens are PHP atomic elements, that are needed to understand and run code. Comments, white spaces and delimiters were not counted, leaving only the useful tokens. Then, the more the larger is the application.

The post lists out the top 100 largest PHP applications (by tokens, not by line) including:

  • Magento2 (#6)
  • Drupal (#12)
  • Yii (#21)
  • Joomla (#36)
  • Symfony (#52)
  • Apigility (#80)

The list comes with the count of tokens and is an update of their 2016 largest PHP applications post.

tagged: large application token size project opensource scanner

Link: https://www.exakat.io/largest-php-applications-2018/

Algotech Solutions:
Converting to another web framework: Basic apps in Symfony and Django
Mar 08, 2018 @ 11:19:34

On their Medium.com site Algotech Solutions has a post that does a side-by-side comparison of two web applications frameworks from two different languages: Symfony in PHP and Django in Python.

Many times have I heard the following from a developer: “I am scared to change technologies”, “I am excited but I’m afraid it will be entirely different”, “I only know , I’ve never seen any code in my life!”. Sounds familiar? This article will show you that different web frameworks are not in fact that different.

With the advent of open source software, modern frameworks have inspired each other in adding and improving features for easier and more efficient usage. I will try to explain the abstract notions under MVC Web frameworks and how you can easily implement them through any framework and programming language needed.

The article then walks through the basic setup and creation of a web application in each, going through:

  • Installation
  • Generating the sample application (Jobeet)
  • Configuring the controllers and views
  • Creating the view output

All of the code and command line calls are included in the post too. If finishes out with an overview of the similarities between the two frameworks and briefly mentions some of the differences (like when it comes to model handling).

tagged: framework convert symfony python django similarities application tutorial

Link: https://medium.com/algotech-solutions/converting-to-another-web-framework-basic-apps-in-symfony-and-django-f55332030c44

CloudWays Blog:
Getting Started With Vue.Js In Symfony
Feb 26, 2018 @ 12:57:04

On the CloudWays blog there's a tutorial posted that walks you through the beginning steps to create a Symfony + Vue.js application with a Symfony 4 application.

As a PHP developer who uses Symfony regularly, I have had a hard time choosing from the numerous JavaScript frontend frameworks available in the market. I had to pick one of the top-rated JavaScript frameworks including Angular, React, Vue and Aurelia.

[...] In this article, I will go through the process of enabling and configuring Vue.js within Symfony applications. Part of this process is covered in the official Symfony documentation.

The tutorial starts by answering the "Why Vue?" question and why frontends are important. He then gets into some of the prerequisites and the steps to create the application:

  • creating the Symfony 4 application via Composer
  • adding a default controller and route
  • making a default Vue.js template via Twig
  • pulling in Vue.js and its requirements via yarn
  • creating the Vue Component

The end result is a simple page that shows the component in a Bootstrap-themed page.

tagged: vuejs symfony tutorial introduction application template javascript

Link: https://www.cloudways.com/blog/symfony-vuejs-app/

CloudWays Blog:
Create A Laravel Vue Single Page App In Under An Hour
Feb 23, 2018 @ 10:15:51

The CloudWays blog has a new tutorial posted that walks you through the process of getting a Laravel+Vue.js single page application running in less than an hour. The instructions for the server portion cover the use of CloudWays' service but they could be applied to any number of other hosting providers.

Laravel has become the most popular choice for developing PHP projects. One important reason for this popularity is the built in support for Vue.js, a very fast growing JavaScript library for developing impressive front-ends.

This combination results is fast, secure and very impressive applications that need minimum time to go from ideation to final code review. The support for Vue.js means that Laravel developers could use Vue components easily within their apps without wasting time in writing integrations for the components. To demonstrate the support, I decided to create a single page application in Laravel with a Vue.js powered frontend.

They start off with a list of prerequisites (software to have installed) and then move on to setting up the database and creating a "tasks" migration. The tutorial then covers building out the authentication handling (via artisan) and the creation of the "task" model and controller. With all of that in place it starts in on the backend functionality to read, create, update and delete the tasks. Next it moves to the frontend showing how to create the Vue.js components required and integrating the Javascript into the view to link it to the backend for managing the tasks.

tagged: tutorial laravel singlepage application spa vuejs task

Link: https://www.cloudways.com/blog/laravel-vue-single-page-app/

Laravel News:
Building a Vue SPA with Laravel Part 3
Feb 19, 2018 @ 11:22:08

The Laravel News site is back with the latest part in their series covering the combination of Laravel and Vue.js to create a basic application. In this latest part (part 3) they continue from the previous tutorials and show how to pull in real data versus the fake data from before.

We will continue building our Vue SPA with Laravel by showing you how to load asynchronous data before the vue-router enters a route.

We left off in Building a Vue SPA With Laravel Part 2 finishing a UsersIndex Vue component which loads users from an API asynchronously. We skimped on building a real API backed by the database and opted for fake data in the API response from Laravel’s factory() method.

If you haven’t read Part 1 and Part 2 of building a Vue SPA with Laravel, I suggest you start with those posts first and then come back. I’ll be waiting for you!

In this tutorial, we are also going to swap out our fake /users endpoint with a real one powered by a database.

They get immediately back to the code, creating a "user" table seeder to generate randomized data and adding it for execution. Next, they switch to the database side, creating the MySQL database for the user data and running the seeding to create the users. The tutorial then shows the creation of the Users controller and what the resulting JSON will look like when pulling all users. Finally, it moves out to the client side and shows how to pull in the data pre-load and push the user details into a template to be rendered.

tagged: vuejs spa singlepage application part3 series tutorial laravel

Link: https://laravel-news.com/building-vue-spa-laravel-part-3

Rapid Web Deployment for Laravel With GitHub, Linode, and RunCloud.io
Jan 24, 2018 @ 12:31:04

On the TutsPlus.com site there's a tutorial posted showing you how to get a Laravel application up and running quickly using the combination of GitHub, Linode and RunCloud.io.

If you are a PHP programmer working with the Laravel framework, I am sure that you deploy your web application on cloud servers on providers like Linode, Digital Ocean, Vultr and the rest. That’s because with a framework like Laravel, which works tightly with tools like Git and Composer, it is less and less likely that your application can be served from a shared hosting environment.

This article will show you how to set up your web server for your Laravel application on Linode cloud hosting using the RunCloud.io server management tool.

They then walk through the process of setting up a server on Linode including instance creation and Ubuntu image deployment. Once this is up and running, they take you over to RunCloud.io to connect your account to the Linode server (by IP address). Once the command is executed to link the two, they then show how to create the virtual host for your application and configure the deployment, DNS, domain name and SSL settings. Finally it shows the connection between RunCloud.io and GitHub, deploying the code when a git push action is taken.

tagged: rapid deployment laravel application github linode runcloudio

Link: https://code.tutsplus.com/tutorials/rapid-web-deployment-for-laravel-with-github-linode-and-runcloudio--cms-30337

Gonzalo Ayuso:
Handling Amazon SNS messages with PHP, Lumen and CloudWatch
Jan 22, 2018 @ 10:46:51

Gonzalo Ayuso has posted a tutorial to his site showing how to handle incoming Amazon SNS messages with a combination of Lumen, CloudWatch and some plain PHP.

This days I’m involve with Amazon’s AWS and since I am migrating my backends to Lumen I’m going to play a little bit with AWS and Lumen. Today I want to create a simple Lumen server to handle SNS notifications. One end-point to listen to SNS and another one to emit notifications. I also want to register logs within CloudWatch.

He starts with the Lumen backend, creating a simple applications that hooks in the AWS and Logging service providers and defines the two routes ("push" and "read"). The post also includes the code for both the AWS and logging service providers and the SnsController. The end result (available on GitHub) then sends a basic SNS message and the response is captured and sent to CloudWatch.

tagged: amazon sns lumen cloudwatch tutorial application

Link: https://gonzalo123.com/2018/01/22/handling-amazon-sns-messages-with-php-lumen-and-cloudwatch/

Asmir Mustafic:
Modular Application Architecture - Considerations
Jan 08, 2018 @ 12:54:36

Asmir Mustafic has continued his series looking at building modular applications with part five looking specifically at some of the considerations and ideas to keep in mind when developing your modular applications.

This is the fifth post from a series of posts that will describe strategies to build modular and extensible applications. In this post we will take a general overview on how some popular design patterns and things to keep in mind when creating plugin based applications.

[...] Anthony Ferrara (alias ircmaxell), in this post blogged about the use of software patterns to implement plugin-based architectures. It is a great article and I suggest everybody to read it. As it is clear from the article, each of this software patterns has a specific use case and the choice of which one to use depends on which the of integration we want allow for the future plugins.

The article starts with a brief recap of some of the more common design patterns including the Observer, Strategy, Decorator and Chain of Responsibility. It then covers some quick uses of these patterns and shares two tips when developing a plugin system for the application and links to good examples for reference.

tagged: modular application architecture series part5 consideration designpattern plugin

Link: https://www.goetas.com/blog/modular-application-architecture-considerations/

Laravel News:
Building a Vue SPA with Laravel
Jan 04, 2018 @ 10:23:08

On the Laravel News site there's a new tutorial posted showing you how to create a Vue.js single page application with Laravel for when you have API-driven applications.

Building a Vue single page application (SPA) with Laravel is a beautiful combination for building clean API-driven applications. In this tutorial, we show you how to get up and running with Vue router and a Laravel backend for building a SPA. We will focus on the wiring up all the pieces needed, and then in a follow-up tutorial, we will further demonstrate using Laravel as the API layer.

They walk you through the creation of a simple SPA that will render the initial content and allow for the browsing back and forth between content without a page reload. The tutorial helps you get all required libraries installed and includes the code to define the Vue router and two routes. The contents of the .vue files are also included as well as the server-side code to power the application.

tagged: laravel vuejs tutorial singlepage application spa introduction

Link: https://laravel-news.com/using-vue-router-laravel