What is PHP?

Some programming languages have been around a while—PHP is one of them. It’s been around since 1994! But, just because PHP has been around the block doesn’t mean it’s not useful today. In fact, PHP has made a comeback in...

The post What is PHP? appeared first on Treehouse Blog.

Single Page App Backends: Where Laravel Beats Node.js

I've been commissioned to write a book about building full stack Vue.js apps. Since many Laravel developers are interested in Vue (Vue now ships with Laravel), the publisher wants the book to focus on full stack Vue.js with Laravel.

In preparing for the book, I knew I would have to answer a very important question for myself: why would anyone even want to use Laravel as a backend for a single page app when they can use Node.js?

Pre-Render a Vue.js App (With Node Or Laravel)

Server-side rendering is all the rage right now. But it's not without its downsides. Pre-rendering is an alternative approach that may even be better in some circumstances.

Server-Side Rendering

One of the downsides to JavaScript-based apps is that the browser receives an essentially empty page from the server. The DOM cannot be built until the JavaScript has been downloaded and run.

Faking Server-Side Rendering With Vue.js and Laravel

Server-side rendering (SSR) is a design concept for full-stack web apps that provides a rendered page to the browser. The idea is that the page can be shown while the user waits for scripts to be downloaded and run.

If you aren't using a Node.js server for your app then you're out of luck; only a JavaScript server can render a JavaScript app.

Avoid This Common Anti-Pattern in Full-Stack Vue/Laravel Apps

If you want your Vue.js single-page app to communicate with a Laravel backend, you will, quite reasonably, think of using AJAX. Indeed, Laravel comes with the Axios library loaded in by default.

However, it's not advisable to use AJAX to retrieve application state on the initial page load, as it requires an extra round-trip to the server that will delay your Vue app from rendering.

Server-Side Rendering With Laravel and Vue.js 2.5

Server-side rendering is a great way to increase the perception of loading speed in your full-stack app. Users get a complete page with visible content when they load your site, as opposed to an empty page that doesn't get populated until JavaScript runs.

One of the downsides of using Laravel as a backend for Vue.js was the inability to server render your code. Was. The release of Vue.js 2.5.0 has brought server-side rendering support to non-Node.js environments including PHP, Python, Ruby, etc.

In this tutorial, I'll take you through the setup steps for Laravel and demonstrate a simple server-rendered app. Get the code for this here on GitHub.

The Ultimate Vue.js and Laravel CRUD Tutorial

CRUD (Create, Read, Update, and Delete) are the basic operations of data storage, and one of the first things you learn as a Laravel developer.

But what happens when you add a Vue.js single-page app as the front-end to this the stack? Suddenly you have to deal with asynchronous CRUD since operations now occur without a page refresh. This will require special attention to ensuring the state of the data is consistent in both the front-end and backends.

Advanced Server-Side Rendering With Laravel and Vue: Multi-Page App

A few weeks ago I wrote a tutorial on the new Vue server-side rendering capabilities for Laravel. That tutorial mostly focused on the set up of SSR in a Laravel environment and so I only had time to demonstrate a simple "Hello World" app with no significant features.

Now I want to build on that previous tutorial and demonstrate how to server render a Vue app that includes multiple pages with Vue Router since most of your Laravel projects will have more than one page.

Reusing a Controller Method for Multiple Actions in Laravel

Hi all, this is Adi with another Laravel tutorial. This time, I wanted to cover my basic solution to a problem we might all have when building web apps using only blade templates.

Let’s take this example scenario and explore possible solutions. We have an index method on, let’s say UsersController, which lists all the users from our database. Each user has a Subscription and we want to change their subscription. How would you go about doing this with pure blade templates?

Laravel 6 — What’s New?

This month we have witnessed a major release of our favorite PHP framework. Laravel is turning eight this year, and the older it gets, the more we like it. Just like a kid… Not to say we didn’t like it before! 

In this article, I’ll give you a quick run through on the most important changes with this major release. 

Best PHP Frameworks (2019)

In this article, we will be discussing the Best PHP Frameworks along with their pros and cons in great depth so that one might get a clear understanding of which one to chose. Our comprehensive research would include some Latest PHP Frameworks.

Table of Contents


Laraberg, a Gutenberg Implementation for Laravel, is Now in Beta

The family of Gutenberg derivatives is expanding with the beta release of Laraberg, an implementation for Laravel. Maurice Wijnia, a developer at Van Ons, an agency based in Amsterdam, created Laraberg as an easy way for developers building applications with Laravel to integrate the Gutenberg editor. It includes a simple API and support for the Laravel File Manager for uploading files.

“The goal for Laraberg is to give developers the ability to add the Gutenberg editor to any page they like in a way that is as easy as possible, but at the same time it has to prove enough options to tailor the editor so it can fit into any Laravel project out there,” Wijnia said.

Van Ons has a preference for using Laravel in their projects, due to its increasing popularity and active community. Laraberg makes it possible for the agency to tap into the convenience of the Gutenberg editor without giving up the performance and features they enjoy in the Laravel framework. The beta release is now available on GitHub and Pacagist. Van Ons plans to actively implement Laraberg in their own projects and will also be collecting feedback from beta testers.

Wijnia said he was inspired by the Drupal Gutenberg project, whose creators also authored Gutenberg.js, a package that makes it easier to bring Gutenberg into other applications. Providing a foundation for using Gutenberg on any CMS or framework is part of Frontkom’s long term vision for improving the open web and enabling communities to collaborate on mutually beneficial extensions.

As the editor continues to expand to more platforms and frameworks, a CMS-agnostic block library would offer a central place for Gutenberg’s increasingly diverse user base to discover new blocks. WordPress.org has the opportunity to provide that in its own block library, with the support of the Gutenberg Cloud team that pioneered the idea in 2018.

“If Gutenberg Cloud can serve as a proof of concept that WP.org can later adopt as their own, we are happy,” Frontkom CTO Per Andre Rønsen said. He also further commented on the WordPress.org Block Library proposal, advocating for the team to grow their vision beyond the WordPress community only. No official decision has been announced yet. If WordPress decides to forgo the opportunity of providing a block library inclusive of other frameworks and platforms, then the Gutenberg Cloud will continue to be the place for discovering blocks that can be used across multiple platforms.

10 Underused Laravel Blade Directives

Laravel Blade is the template engine that’s built into the framework. It makes working with HTML a breeze. I have been working with Laravel for more than a year, but never realized some of Blade’s features. I want to share with you 10 underused blade directives that will clean up your code and save some time in the process. Let’s get going.

Check out LaravelCollections.com - an ever growing collection of great Laravel resources