The Laravel ecosystem is currently one of the most popular solutions in the PHP world. The original Laravel library has gone from being a simple library to a complete organization of libraries and associated services. Once you start implementing a part of Laravel, you fall into the rabbit hole, and you never know how much Laravel technology you are going to adopt. In addition to the basic set of services, the common practice at Laravel often associates other well-known technologies such as Redis, Vue.js or Tailwind CSS.

For starters, Lumen is the micro-framework created by the Laravel team as the lightest flavor of the platform. It comes with a minimum set of features. After implementing the base package, you are free to adopt any of the other Laravel packages or services. For more information about Lumen: https://lumen.laravel.com/docs/5.8

To begin with Laravel Lumen on Joomla

Why Laravel Lumen on Joomla?

The Lumen microframework provides an agnostic API, independent of a specific CMS, to access the complete platform of Laravel libraries and integrated services. In our case, we started to implement Lumen as the basis of a family of packages for Joomla, PrestaShop, and WordPress. In our systems, the core business model is implemented following Laravel practices, other top layers are developed as needed, and the lower layer interacts with the underlying CMS to integrate functionality where needed.

Laravel evolves rapidly, and each version implements the latest PHP features available. Laravel 5.8 is the latest version, compatible with 7.1 or higher. Laravel 5.5 is the latest version of LTS, supported until August 30, 2020. Laravel 5.4 was the last version compatible with the PHP 5 branch (no longer supported). In September 2019, Laravel 6 was released. For more information about Laravel versions: https://laravel.com/docs/master/releases#support-policy

Being Eloquent on Joomla

The Eloquent ORM (included with Laravel) provides a simple implementation of the ActiveRecord pattern to work with the database. It is the cornerstone of the architecture and the first step to understanding the Laravel philosophy. The Query Builder is remarkably similar to the Joomla Query Builder, so the use sounds familiar and feels like the natural first step for an integration project. Eloquent is in full evolution, implementing new functionalities. For example, one of the notable new features of Laravel 6 for Eloquent is the improved subqueries support: https://laravel.com/docs/6.0/releases

Beyond Arrays, Collections

In PHP, the use of arrays requires a variety of language features, properties, methods, functions and objects, the result of the odd evolution of PHP. To simplify all this complexity, Laravel has Collections. This library provides a consistent and powerful vision for data management. As an example of the possibilities, in Laravel 6, the collections library has incorporated batch processing: https://laravel.com/docs/6.0/releases

A basic component integrating Lumen

To start implementing a new stack in Joomla, the initial step is to identify what we really need to use. Let's start with a component to integrate Laravel Lumen.

In Joomla, a basic component only needs to implement one file, the entry point. In our case, to create an "XT Lumen" component, then you only have to include a file named as the component. For example, xtlumen.php. Within this file, you only need to initialize the Laravel application and render content. If you invoke the component manually with https://my-site.com/index.php?option=com_xtlumen&view=app, you get the output generated by the component.

To illustrate the concept I have created the project anibalsánchez/laravel-lumen-boilerplate-for-joomla

This extension installs a component and uses Lumen to produce a "Hello Joomla" view from Blade, in the backend or in the frontend. To start, you can download and install the extension here: https://github.com/anibalsanchez/xt-laravel-lumen-boilerplate-for-joomla/releases/download/1.0.0/pkg_xtlumen_v1.0.0.zip

Beyond the first steps

After these steps, a world of possibilities opens up, and surely many more questions about how to combine the two platforms. With the previous package, Laravel Lumen is already correctly initialized and working in the context of Joomla to generate an output. From this proof of concept, it is possible to advance in the definition of the Routing, Middleware, Views, Models, Service Providers, and the container.

Simplicity is the ultimate sophistication.

 

 

 

 

 

Read more

Participants: Jaz Parkyn, Chris Keen, Vikas Pisal

Department Coodinator:

  • Jaz thanked everyone for their votes in the election, and is looking forward to serving another term.
  • Options about holding a department sprint were discussed and will be reviewed within the coming weeks.

Certifications:

  • Development on Shika and the question management and translation component is going well overall. The team is currently facing a
...

Read more

JED Team Meeting

The Joomla! Extensions Directory (JED) team met on August 2nd, 2019, at 4 pm GMT, via Glip to discuss our progress of current tasks.

  • In attendance: Anibal Sanchez, Jaz Parkyn, Luca Marzo, and Mark Lee.

  • Absent: Daniel Dubois, Dénes Székely, Hugh Douglas-Smith, and Troy Hall.

Plans for 2019

  • New Ticketing System / Process
...

Read more

JRD Status: 

  • August 20 - September 3, 2019
  • Approvals total: 455 - no change from last time.

Topics

Discussion about upcoming Joomla board nominations and future leadership roles and responsibilities on the JRD team. No decisions were made but different scenarios were discussed.

On the call:

  • Brian
  • Deb
  • Karen
  • Richard

Upcoming meetings:

  • September 17, 2019
  • October 1, 2019

 

Read more

© 2019 Extly, CB - All rights reserved.