Creating Laravel Project0:00
We're going to create our webshop project. If you haven't already, be sure to check out the documentation and install all the necessary resources on your machine in order to run a Laravel application. For example, you can use Laravel Valet, which I'm using, or you can use Laravel Sail to use Docker. If you've already been set up, let's run the composer command to create our webshop project. Perfect. That's all set up. Next, we can install Laravel Jetstream.
Introducing Jetstream0:29
That's all set up. Next, we can install Laravel Jetstream. If you're unfamiliar with Jetstream, Jetstream is a first-party Laravel package that ships with authentication, registration, problem management, password updating, two-factor authentication, browser sessions, and much more. Our customers will probably need this. They want to create an account. If they change their email address, they might want to update their account information. Let's save some time by using Jetstream. Jetstream ships with two different stacks that you can choose between Livewire or Inertia.
Installing Jetstream Livewire0:59
Let's save some time by using Jetstream. Jetstream ships with two different stacks that you can choose between Livewire or Inertia. We're going to go with Livewire in this case. Let's first run the composer require command. Next, you can see that we can run the php artisan jetstream:install command and provide the stack that we want to use. Let's do it now. php artisan jetstream:install livewire. As you can see, this will install the Livewire dependency for us, and it will also install all the necessary tailwind and CSS resources.
Confirming Livewire AlpineJS1:28
As you can see, this will install the Livewire dependency for us, and it will also install all the necessary Tailwind CSS resources. Okay, that's all done. So Jetstream has already installed Livewire for us. In case you're using a separate project, be sure to check out the livewire.com documentation where you can find all the necessary instructions required in order to install Livewire. It's really easy. It only takes a minute. Next, we want to make sure that we have AlpineJS installed. Okay, all set.
Configuring Database Migrations1:53
Next, we want to make sure that we have AlpineJS installed. Okay, all set. Tallwind is also already installed by Jetstream. If you want to install it manually, check out the Tallwind CSS documentation, and you can find all the details right here. Perfect. Let's open our project in PHPStorm. Let's set up our database and run the migrations and ensure that we can access our project via the web browser. If we go to our .env file, we can see that it uses MySQL right now, and that's what
via the web browser. If we go to our .env file, we can see that it uses MySQL right now, and that's what we're going to use in this demo as well. But you can choose SQLite or any other database as long as it's supported by Alpine. I'm going to switch to TablePlus, where I have my local MySQL database. I'm going to create a new database called Laravel. I'm just going to set the encoding. Okay, so now we have our database opened up in TablePlus. Let's run the migrations. There you go.
Verifying Setup in Browser2:54
Let's run the migrations. There you go. Our tables have been created. Let's verify this in TablePlus. There we go. All the tables are there. Let's visit our application in the browser. There you go. There you go. We have Laravel installed, WidgetStream, LiveWire, AlpineJS, and TokenCensus.
There you go. We have Laravel installed, WidgetStream, Livewire, AlpineJS, and TokenCensus.
