Getting started with Laravel 10 Livewire 2

04-06-2023 - Andrés Cruz

Getting started with Laravel 10 Livewire 2 En español

Conditions:

  • Lifetime Book in the Kindle Store (Amazon)
  • Pdf, mobie, epub (Leanpub)
  • Frequent updates to add more and more sections and maintenance.
  • Contact by messages

Laravel is a fascinating framework, huge and with a somewhat steep learning curve and with multiple options; this book is not for beginners and assumes that you already know how to program in Laravel.

Laravel Livewire takes Laravel development a step further; automating routine processes in very flexible schemes based on components, Livewire components that allow us to communicate client and server in a very simple, efficient and easy way.

Laravel Livewire is not a framework, it is just a layer or scaffolding that adds certain extra features to the framework that we can use to create great applications, with less effort and development time.

 

Who is this book for

  • This book is aimed at anyone who wants to start developing with Laravel Livewire in developing applications based on Laravel components with some additions that allow direct communication between server and client.
  • This book is not recommended for those people who have not worked with Laravel, if this is your case, I advise you to first know and practice with Laravel before starting; on my website you will find courses, books, publications, videos and in general more information about Laravel.
  • For people who want to improve a skill in web development, who want to grow as a developer.
  • As long as you identify with at least one of the points mentioned above, this book is for you.

Introduction

This guide is intended to get you started with Laravel Livewire; with this, we are going to pose two things:

  1. It is not a book that aims to know 100% Laravel Livewire, the main objective is to know its main components based on examples.
  2. It is assumed that the reader has at least basic knowledge of Laravel.

Laravel, being a more complete framework that you want to deal with, in practice, has many more components to work with, it is assumed that the reader has some basic knowledge about how the framework works, such as the use or theory of what migrations, MVC, routes, among others, work for; you don't need to know how to handle them, but you do need to understand the logic behind it all; if you don't have them, I recommend that you see my first web programming book in which we take the first steps with CodeIgniter, which is a great framework with many similarities with Laravel, and being a smaller framework and easier to handle is more easy to start your learning.

Finally; compared to other books, the approach will be a little more accelerated or general when it comes to the explanations of the elements that make up the framework; and this is so for two main aspects:

  1. I want to cover as many of the features of Laravel Livewire without making the book too long.
  2. This is not a recommended book if this is the first PHP framework of this type that you are facing, therefore, being so, you should already know these aspects of the structure of the framework.

To follow this book you need to have a computer running Windows, Linux, or MacOS.

Remember that the book is currently in development.

Map

This book has a total of 15 chapters, it is recommended that you read in the order in which they are arranged and as we explain the components of the framework, go directly to the practice, replicate, test and modify the codes that we show in this book.

  1. Chapter 1: In this chapter we are going to give a brief introduction about Laravel Livewire.
  2. Chapter 2: In this chapter we are going to create our project in Laravel Livewire.
  3. Chapter 3: In this chapter, we present the characteristics that a project created in Laravel Livewire has; team management, API Tokens, and authentication, are some of them.
  4. Chapter 4: In this chapter, we are going to create a simple CRUD type application and get to know all the elements of Livewire such as handling forms, views and directives through the Livewire components.
  5. Chapter 5: In this chapter, we are going to work on the style, improving the created application so that it looks like another Laravel Livewire module.
  6. Chapter 6: In this chapter, we are going to learn about the communication between Livewire components based on events; detect changes in properties of the component class from the view and know the Laravel Livewire JavaScript.
  7. Chapter 7: In this chapter, we are going to create the CRUD for the posts.
  8. Chapter 8: In this chapter, we are going to create filters and search fields for a listing taking advantage of the benefits of Livewire.
  9. Chapter 9: In this chapter, we are going to create sort fields for the column listing.
  10. Chapter 10: In this chapter, we will get to know everything that Livewire offers us in JavaScript and combine it with other plugins, we will know the hooks in JavaScript, consume properties, functions and use of events.
  11. Chapter 11: In this chapter, we are going to learn about some extra features of Laravel Livewire properties, such as customizing the update phase of wire:models, such as the use of computed properties.
  12. Chapter 12: In this chapter, we are going to create a simple blog application with a list with filters and search and detail fields.
  13. Chapter 13: In this chapter, we are going to create a shopping cart in the session and database, for which, we will see communication between components, sending events, toast type plugin to show messages confirming the operation carried out, with listeners of the events from JavaScript.
  14. Chapter 14: In this chapter, we are going to show the code of an application created with Alpine.js to create a to do list component.
  15. Chapter 15: In this chapter, we are going to adapt the Alpine.js application presented in the previous chapter, to work in conjunction with Livewire.

Livewire is a scaffolding for Laravel, which is nothing more than a skeleton or layer that adds certain extra features in Laravel through the use of Livewire components; the same basic Laravel components, but with very interesting additions that are what make up Livewire.

In addition to this, a project in Livewire already brings us Tailwind.css and Alpine.js configured.

In this book we will use the term “Basic Laravel” to mean the Laravel framework without any add-ons or scaffolding as is the case with Laravel Livewire.

What does Livewire offer us?

Building modern web apps is hard, tools like Vue and React are extremely powerful, but the complexity they add to a full-stack developer's workflow is insane.

With the above in mind, Laravel Livewire is a complete framework for Laravel that makes it easy to create dynamic interfaces, without leaving the convenience of Laravel; in short, it allows us to use schemes similar to those of Vue and React directly in Laravel.

We can work with schemes similar to those of Laravel and Vue, but in a more direct and simple way; Laravel development is heavily tied to the use of components; the same Laravel components but with important additions from Laravel Livewire which allows you to greatly scale the use of components:

  1. Link using the routes file.
  2. Simple communication based on actions, events and functions between the client and the server.
  3. Add features such as pagination, file upload, query string among others.

In short, with Livewire, we can do the same thing that we do with Laravel and its controllers, but in a simpler way in which we can use the components and reuse pieces of code that Livewire offers us to make a very simple communication between the server with the client.

Apart from that, depending on how you decide to install Laravel Livewire, you can enable options that come for free like:

  1. Authentication system with registration, credential recovery.
  2. Profile view with user upload.
  3. Management of roles through teams.
  4. Handling the Tokens API using Laravel Breeze with a manageable interface.

In short, Livewire is not a framework, you can see it as another package that adds extra features to some Laravel elements that ultimately make it a scaffolding or skeleton for our applications.

For this technology, we have to use two separate documentations (not counting Laravel).

The one offered by the project structure:

https://jetstream.laravel.com/2.x/stacks/livewire.html

And the one that Laravel Livewire offers us when developing:

https://laravel-livewire.com/

Finally; compared to other books, the approach will be a bit more accelerated or general when it comes to the explanations of the elements that make up the framework; and this is so for two main aspects:

  • It is assumed that the reader has knowledge of basic Laravel.
  • Being a more practical technology, it is based on above all giving examples and creating real applications.

Andrés Cruz
Desarrollo con Laravel, Django, Flask, CodeIgniter, HTML5, CSS3, MySQL, JavaScript, Vue, Android, iOS, Flutter

Andrés Cruz en Udemy

Acepto recibir anuncios de interes sobre este Blog.

Conozca nuestros cursos sobre Laravel, CodeIgniter, Flutter, Electron, Django, Flask y muchos más!

Ver los cursos
¡Hazte afiliado en Gumroad!

!Cursos desde!

4$

En Academia

Ver los cursos

!Libros desde!

1$

Ver los libros
!Web Alojada en Hostinger!