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

Developer Improvement Pillars0:00

If you want to improve as a developer, there's essentially three things you need to focus on. One, you gotta learn. So that's where you go to the class, you watch the screencast, or you read the book, or you sit next to a person who can mentor you. That's a really important step. Number two, you have to write a lot of code. And it goes without saying, right? But sometimes people get caught up in the learning aspect, where they read constantly, and they're watching tons of videos. But don't forget, you have to put that to practice, where you actually write code. And then the third category is, you need to read a lot of code. All right, so three things, learn, write code, and read code. This series will focus on the latter, and we'll keep it close to home. We're going to read the Laravel.com source code, and specifically the documentation. We're going to figure out how this is constructed.

Cloning and Installing Dependencies1:19

Okay, so we can see, yeah, I mean, things like this aren't really meant to be used by multiple people. But if we do, it looks like there's a marketing page, and then everything else is the documentation. Next, the website's documentation is loaded from the resources/docs directory, so we need to clone that from this repository. Okay, let's get started. Let's see if we can get this up and running locally. I will clone it, and then cd to that project, and open this up in Sublime. So right away, I can see a couple things. One, we don't yet have our vendor directory, so we need to install the dependencies. And then two, it looks like this project is still using Laravel Elixir. Really, I should submit a PR to switch that over to Mix, but no big deal. But that does mean we also need to install our npm dependencies. So let's do that as well. npm install. And then once we're done, I will also run npm run dev. And that's just a standard in

Fixing Environment Setup Errors2:06

But that does mean we also need to install our npm dependencies. So let's do that as well. npm install. And then once we're done, I will also run npm run dev. And that's just a standard in Laravel that will compile everything down. And it looks like in this case, as part of that, it will also boot up the watcher. So we'll give that just a second. And there we go. It's all compiled down. Okay, so now, I doubt it's ready yet, but let's go to laravel.com.test, and we get a whoops error page. So as you know, this is what you'll see in production. And I think the issue is, yeah, there's no .env file. So we need to create that. So I think this will be a case if we switch back, there's no example .env file we can use. So I'm hoping I can grab the default for Laravel. So that will be at the laravel/laravel repo. And hopefully, that should be enough. So let's grab the raw data there, and I will paste it in. All right, so now let's go back to Chrome.

Generating App Key and Testing2:53

that will be at the laravel/laravel repo. And hopefully, that should be enough. So let's grab the raw data there, and I will paste it in. All right, so now let's go back to Chrome and give this a refresh. But now we get no application encryption key has been specified. All right, fair enough. php artisan key:generate. One more time. There we go. It's working. Excellent. So we can see all the assets are here, everything's compiled down. But yeah, I think the bulk of it is going to be the documentation. So we click, the default is 5.6. And yeah, I can see it's loading a 404 type thing here. So I think this is where we need to come back to our project. And yeah, you'll see all of the documentation is stored on GitHub, and it has to be cloned into a resources/docs version number directory. So that means we could make a directory resources/docs/5.6. And we don't have a docs directory. Quick tip, you can use -p for make directory.

Cloning Documentation into Resources3:41

docs version number directory. So that means we could make a directory resources/docs/5.6. And we don't have a docs directory. Quick tip, you can use -p for make directory. And that's basically saying I want a recursive create. Okay, now it creates that full tree. Next, it looks like you need to clone in every single branch. And for the documentation, the source code, the markdown files are all contained according to the version number. In our case, we're only interested in 5.6. So I'm going to clone that into the resources/docs/5.6 directory. I think that should do it. Okay, so if we come back, give that a refresh. Still not. Let's see, did that work correctly? resources/docs/5.6/docs, you know what, I assume all of these files need to be direct children of 5.6. So let's just do a quick move. So docs everything in there into the current directory. Alright, get all the files.

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