Skip to content

Details

Hey there,

In this online event we're going to begin playing with Laravel Livewire. No prior experience with Laravel or Livewire is necessary though it will be helpful to have experience with programming and web development. Your host, Connor, hasn't used Livewire but he does know Laravel. I have a project in mind so we'll see how far we get and what we can learn along the way :)

## What is Laravel Livewire?

Before introducing Laravel Livewire let's review the current state of web development and the problem Livewire seeks to solve. Prior to Livewire there were two primary ways of building web frontends: You could build front ends using Laravel's built in template engine called Blade, or, alternatively, you could build more interactive websites using a Javascript framework like [Vue.js](https://vuejs.org/) or [React.js](https://reactjs.org/) and communicating with the backend via AJAX or GraphQL. There are pros and cons to both approaches..

Blade templates are nice because the code can be relatively simple; you define variables in the controller and use them in the view. The variables have access to all of the PHP model methods and there are plenty of blade helpers for conditionally displaying data, looping over lists and breaking the view into layouts and partials. Code can be reused across views and everything is in .php or .blade.php files. Rendering data via Blade templates is the MVC pattern at its finest. This pattern was a revolutionary breakthrough in web development first pioneered by DHH with Ruby On Rails nearly two decades ago. Unfortunately it has some shortcomings.

Enter Vue.js, React.js et al. These web frameworks sought to solve the problem of Blade templates, erb files in Ruby or views.py files in Django by handling the logic themselves. To communicate with the backend databases they needed to send AJAX requests. With AJAX requests there needed to be API endpoints to provide the data. Facebook pioneered GraphQL to allow front end developers to specify the data they wanted, but regardless view logic needed to be handled with frontend Javascript. To manage state with these frontend frameworks we built tools like Redux, Vuex and Mobx. React introduced Hooks. We introduced a lot of complexity to gain interactivity, but maybe it doesn't have to be this way?

This is my hope for Laravel Livewire. Livewire promises to make dynamic web interfaces simple. There has been a backlash against complex web frameworks resulting in more new tools. Livewire is part of a movement in web development to make interactivity simpler for developers. Hotwire, [Inertia.js](https://inertiajs.com/), Remix and even [Alpine.js](https://alpinejs.dev/) are looking to solve this problem. Livewire promises to build interactive websites with PHP but there will be some new concepts we need to learn.

## Okay, that was a lot. What will we be building?

I work on a side project called Employbl. In this session I'll be live coding interactive search for job listings. The codebase for Employbl isn't open source but I'm happy to share what we do in the meetup via GitHub gist :)

## What do I need to bring?

A positive attitude and curiosity 🚀

Related topics

New Technology
Computer Programming
Laravel
Software Development
Web Development

You may also like