Finding File Templates 0:00Imagine that we want to create a new class, maybe something like a new Eloquent model. Well, if you watched the previous lesson, you know that we can press Command-Up, Command-N, create a class, and let's call that, how about, a task, and we're done. But now, notice this little file template right here. That's a little odd. Well, luckily, we can customize this however we want. So, let's review that in this lesson. Now, I can press Shift-Command-A, like we talked about, to enter any action, or if you ever just want to search anything and everything, you can press Shift-Shift. Okay, so let's look for the existing file templates. So, essentially, what we have here is a variety of dynamic snippets that will be inserted when a file of the appropriate type is created. So, in our example, when we created a new PHP class, notice that it includes this Editing PHP Class Template 0:40is a variety of dynamic snippets that will be inserted when a file of the appropriate type is created. So, in our example, when we created a new PHP class, notice that it includes this file header here. We can check that out. If we review that, it inserts just a little dog block there. But in our case, we don't really want that. I don't care about it that much. Next, you can see we can do conditionals here. So, if a namespace was provided, then insert it here, and then add a class with the name. So, let's try that. Save our changes, create another file within our app models directory, and this time, we'll add a class called Post, but let's give it a namespace of Acme. Click OK, and there you go. We're all done. Also notice that it was smart enough to parse the file name and create a class of the correct type. So, this is helpful, but in our case, we actually wanted an Eloquent-specific model. Creating Eloquent Model Template 1:28Also notice that it was smart enough to parse the file name and create a class of the correct type. So, this is helpful, but in our case, we actually wanted an Eloquent-specific model. So, here's what we might do. I will press Command-Comma to return to where I last was, and let's add a new one. How about Eloquent model, and we do want an extension of PHP. All right. So, I will just copy and paste some of this within here, clean this up just a touch, and now we will make sure that it extends Eloquent, and then also, why don't we give it just a bit of beginning boilerplate. So, we'll set the fillable property. I'm also going to escape that dollar sign just so PHPStorm knows that I'm not referring to a PHPStorm-specific variable. So, let's test it out. Command-Up within the app directory, within the models directory, let's create a new Eloquent model, and how about we use Testing the New Template 2:09referring to a PHPStorm-specific variable. So, let's test it out. Command-Up within the app directory, within the models directory, let's create a new Eloquent model, and how about we use a name of Order with a namespace of Acme. There you go. We're all set to go. So, you don't want to go crazy with these file templates, but at the same time, from my experiences, people tend to ignore them entirely when, in fact, they can be incredibly useful.