In this episode, we start with a fresh Laravel app and walk through the initial setup to get it ready for building out features. First, we jump into the web routes and clear out the default welcome view. Then, we get Livewire installed using Composer, making it super easy to start adding dynamic components to our app.
Once Livewire is set up, we create our first Livewire component for the home page, which will be the main area to display employees and services. Instead of going the traditional controller and blade route, we hook this component up directly to our web route, making our home page powered entirely by Livewire.
We hit a small snag when we see an error about missing layouts, but quickly fix this by generating a global app layout with Livewire's CLI tool. We also tidy up the layout by making the page title dynamic, using either a passed-in variable or pulling it from our app configuration.
Next up, we install Tailwind CSS for styling. We follow the Laravel docs: run npm install, generate the Tailwind config, and make sure Tailwind scans our Blade files for any CSS classes. We import Tailwind into our main CSS file, update our app layout to pull in the CSS and JS via Vite, and start the dev server.
To finish off, we set up a responsive and centered container for all our content, giving us a clean base to work from. By the end, we’ve got a working Laravel app with Livewire and Tailwind fully set up and ready to build out more features!