در حال بارگذاری ...

Faster file creation0:00

One thing that can be annoying out of the box is adding files. So if I need to create a class here, maybe a new Middleware, and I'm not using an artisan command, you kind of do this thing, and it always feels a little gross to me. Instead, I like to use a package called advanced-new-file. Okay, so this just makes the process that much faster. Now, I believe it should be scoped to Command + Option + N. Yeah, and now you'll see at the very bottom we have a path to enter a new file, and this will work for files and directories. So once again, Command + Option + N, and I could say app/ folder, and I'm just going to end it with a forward slash to designate that I do need a new directory there. All right, let's do another one though. Maybe I want app/foo.php, and you'll see that it immediately creates that file. So again, just a small thing, but it will save you so much time. Now really, that's all there is to the package. There are some configuration

Current directory shortcut0:43

and you'll see that it immediately creates that file. So again, just a small thing, but it will save you so much time. Now really, that's all there is to the package. There are some configuration and alias options, but I will show you one other thing you can do. Sometimes, like let's imagine I'm in a middleware, and I'd like to add another file within the same directory. Well, you don't have to say enter a new path app, and by the way, you can do tab completion. So I can type h tab, and it'll fill that in. So middleware new file, you don't have to do that. Another option is to command option n, and then begin with a colon, and think of that as a keyword that means the current directory. So if I say new file.php, it will add that specifically within the current directory. So I use that one quite a bit, and that's it. So pull it in and use it.

دوست دارید گاهی خبرهای Laracasts را ایمیل کنیم؟