Clean Install via CLI0:00
Alright, let's get started. First step, installing Statimix. There's two main ways you can do it. First would be a brand new clean install. And second would be into an existing Laravel application. The clean install is simpler, has a few less steps, so let's do that first. The best way to do this is to install Statimix Global Composer CLI tool. So we're going to run composer global require statimix/cli. Now I already have that installed, so that was pretty quick. Now we have a statimix command, so we can run statimix new, and we'll call this larasmash.
Create New Blank Site0:31
Now I already have that installed, so that was pretty quick. Now we have a statimix command, so we can run statimix new, and we'll call this larasmash. Next you'll be given a choice between a blank site and a starter kit. Starter kits are pre-built site kits that are ready to go, just drop them in, and you have a fully built site. So considering we're learning Statimix here, let's go with the blank site. Composer's doing its thing. Now it'll give us a prompt to create a new super user, which we're going to do. And I've already started the repo, so I'm just going to say no. Now we're going to change directory into a new project, larasmash, and let's make sure
Open Site and Login1:19
And I've already started the repo, so I'm just going to say no. Now we're going to change directory into a new project, larasmash, and let's make sure it's working. So we're going to run valet open. There we go. We are rendering a site with Statimix. Great. Let's test that the User works. So we're going to go to /cp, which stands for control panel. We're going to run login with my user, and there we go.
So we're going to go to /cp, which stands for control panel. We're going to run login with my user, and there we go. We are up and running. This took care of all of that typical Laravel stuff, like setting the .env file, generating the application key, and then unzipping Statimix compiled control panel assets, JavaScript and CSS that runs the actual control panel. So all that is done automatically for you. When we install Statimix into an existing Laravel application, like we're going to do next, you have to do some of those steps ourselves. So let's get into it.
Install into Existing Laravel2:10
next, you have to do some of those steps ourselves. So let's get into it. You're going to want to follow along with the Laravel install in our docs, because there's a little bit of copying and pasting that should go a long way. I'm going to come down here, and the first thing we're going to do is run php artisan config:clear. So I'm going to pop into this brand new Laravel app that I just generated. Nothing special, just a blank Laravel app. Next we're going to run php artisan config:clear. Pop back to the docs.
Update Composer and Install2:40
Next we're going to run php artisan config:clear. Pop back to the docs. Next we need to add this command, statimix install, to the post-autoload-dump section of your composer.json file. So let's open up this project, open up composer.json, go down till we find post-autoload-dump, add this command, and done. Next we're going to install statimix with composer, just a standard command. Now you'll be asked to install this pixel-feather composer disk plugin. This is written by Jason Varga, who's on our team. This literally just allows composer to run like an unzip command on the control panel.
This is written by Jason Varga, who's on our team. This literally just allows composer to run like an unzip command on the control panel assets. So kind of need to use this, or else you have to do even more stuff by hand. So just hit yes, allow it, and everything should work. Now that's composer two thing. If you're still using composer one, you won't see that prompt. There we go. Now let's see what happens if we go to /cp on this project. Great, we can see we've got statimix installed.
Configure User Storage3:43
Now let's see what happens if we go to /cp on this project. Great, we can see we've got statamic installed. Now there's one additional step, which is configuring where statamic is going to look for your users. By default, it's going to assume it's in a database when you're running a Laravel application. So all you need to do is decide whether you want them in an existing Laravel app, or if you want to put them in flat files, like in a standard statamic site, and follow those additional steps. Whichever method works for you is fine. It all depends on your needs.
