DevLaive's Posts
Nairaland Forum › DevLaive's Profile › DevLaive's Posts
HeatSeeker:Thank you for this information. It's very much appreciated 👍 |
Hello tech brothers and sisters! I have intentions to relocate to Lagos state and specifically to a place where accommodation will be a bit affordable and yet where tech opportunities will be readily available. I am into web development and I have missed some opportunities because I work remotely and some potential clients (mostly from Nairaland) who contact me assume I have a physical presence in Lagos. I explain why it's so. I heard cost of accommodation is way more affordable in Ikorodu compared to some other parts of Lagos. I don't know much about the state and I'll need suggestions of better places with affordable accommodation plus tech opportunities specifically in web Development. Thank you! |
The so-called Alex got into software development in less than 4 months and even got a job?? Really?? This sounds unrealistic. Learning software development takes time and requires a lot of practice in order to master the skill. Besides, "He" didn't mention the languages/frameworks that were taught during the course, neither did he mention the projects he built while learning. Mastering even the very basics of software development takes time and requires a lot of practice. Let's be realistic. |
Lionize:Done bro 👍 |
Oseniade:You can learn directly from me. Distance isn't an issue. 😊 |
fnep2smooth:Yeah. You're right. But Artisan commands are outside the scope of this theoretical introduction to Laravel. 😊😊 |
Lionize:I got the invitation, but unfortunately I missed the meeting due to network failure. I am into web development. |
I am interested. I have sent you a mail sir |
To learn more, let's talk through a direct message. |
As you can see above, in simple terms, the register() method will handle user registration logic. The login() method will check if the details the user entered are correct or not. If correct, the user will be logged in, otherwise, the user will be denied access. The create_topic() method will handle the logic of creating a new topic and storing it using the associated Model. The create_category() will handle creating and storing new forum categories. The list_topics() method will handle fetching all existing topics created by users. The show_single_post(identifier) method will handle fetching a single topic based on the identifier that has been passed to it. That's it! |
Finally, let's talk about the required Controller files. Well, we can use just one Controller file. But the controller will contain multiple methods (call them functions) and each function handles a particular/specific task such as displaying a form, showing a topic, etc. For our case, let's call the Controller ForumController. Now, inside this controller class we can have the following methods: 1. register() 2.login() 3. create_topic() 4. create_category() 5. list_topics() 6. show_single_topic(identifier) The bodies of these 6 methods above will handle the logical aspect of our project. Let's explain each |
Now that we have seen the models that will be needed for our Forum project, what about the Views?? Well, we will need 6 different views. Here: 1. register : This guy presents the registration form that the user should fill in order to register. 2. login: This guys displays the login form. 3. create-topic: This guy presents another form for a user to create a new topic after they have logged in successfully. 4. list-topics: This one presents a nice list of all created topics in our forum. 5. create-category: This will help create new category/section. 6. show-single-topic: This will finally help us to view a single topic and read it's content. |
First, since people will be able to register, that means we need to store their information somewhere. Remember, our "somewhere" is called the database. The first Model we will need is the User model to store users of our forum. The second model we will need is Category model to store categories/sections of our forum. The third and final model we will need is, guess it! Yeah, you got it. We will need the Topic model. So the three models are User, Category and Topic. Notice I didn't pluralize the model names. That's a convention in Laravel. Model names should be written in singular form. |
Now that we know what MVC stands for and what it is all about, let's picture how we can apply this knowledge at least in theory. Let's say we want to build a forum like Nairaland. A basic version of it of course. 😊 In this situation, we need to be clear about what we want. So let's see. 1. We want users to register 2. We want users to be able to login 3. We want to have categories/sections 3. We want users to be able to create topics in a particular section/category 4. We want to store the topics that users created. 5. We want people to view the created topics by clicking on them. Simple right? Let's see the Laravel Models that will be needed for this project as well as the Views as well as the Controllers we will be needing. |
Now, the C in MVC stands for Coffee ☕! Ohh, sorry, it stands for Controller! 😊😊 Think of the Controller as the main engine of your web application. It handles the logic of what the user should be shown anytime they make a request to a certain part of your project. The Controller is just like a messenger that listens to his/her boss. When they messenger gets instructions from their boss, they act based on that instruction. If the instruction is not clear, the messenger won't know what to do. But if the instruction is clear, the messenger does exactly what's required. That's is how the Controller is. If a user makes a request to view another user's profile, it's an instruction to your application. In this case, it is the responsibility of your Controller to process that request and if it is successful, present the result to the screen! That's basically it for MVC! |
Okay! The V in MVC doesn't stand for vehicle! Nope! It stands for View. Yes, View!!! Every web application needs to present data to visitors or users (let's use users 😉). That data could be static data or dynamic data that is fetched from the database (handled by the Model). See, if your application doesn't present data, it is useless. Nobody wants to see blanck pages. So, your View shows your users something. It could be your products, your customers, your customer reviews, your stories or just anything. So anytime you want to present something, just feel free to create a View and show your data there! Easy right? But how about the C in MVC? What does it stand for?? |
MVC stands for Model, View and Controller. Let's explain each one. Model : This guy handles everything related to data storage and retrieval. Yes! If you want to build an awesome project that stores information somewhere (somewhere == database), then you simply need to engage the services of a model. For example, if I want to create an e-commerce application, then I will need to store my products somewhere. I will also need to store my customers somewhere. How about their reviews of my projects? Yes, I can store that too. It is the model that helps me do that! But what does the V stand for in MVC? Lets see that one next! |
Next up, let's talk about the basic architecture that Laravel uses. Laravel is built using the MVC architecture. Don't worry, it's not difficult at all. Let me explain it. 😊😊 First, by architecture, we don't mean it was drawn by an architect using the pencil and white paper. Nope! By MVC architecture, we mean it's just a style or pattern that the framework follows. So, when building your applications on that framework, it must follow that pattern. But what is MVC?? |
First things first, Laravel is just a PHP framework that abstracts (or removes) the difficulty/complexity involved in using plain (vanilla) PHP when building web applications. For example, if using a normal saw blade to cut through wood makes you sweat, using a machine saw will be easier. So in this case, the hand saw is plain PHP, while the machine/mechanical saw is a PHP framework such as Laravel. When you know what you are doing, using a framework like Laravel in your project is like cutting through butter with a hot knife.😉😉 It cuts through easily. If that's clear let's move on. |
I've noticed so many people want to learn how to build web applications from scratch. But they end up in boot camps that only teach JavaScript/NodeJS. While this JavaScript and NodeJS are cool and considered modern tools for building web applications, it's worth mentioning that PHP has seen a lot of improvements lately. In fact, PHP powers a significant percentage of websites or web applications online today. One of such typical examples is WordPress, a very powerful content management system you can use to build just about any kind of website. Laravel, a PHP framework is very powerful framework that makes building web applications a piece of cake if only you understand the basics of HTML, PHP and maybe some database management tools like MYSQL. In this thread, I will try to introduce Laravel to you in very simple terms. Once you grasp the basics of what I'll say here, getting started with actually using Laravel will be easier than you thought. 😉 Let's delve in!! 🙌🙌
|
stuffs2002:Well, I wasn't there... Unfortunately. |
QuinQ:We lost him in year 2006 after a prolonged illness. Just recently, I stumbled upon some of his notes and other materials and took this one and others to my archives. |
I stumbled upon my late Uncle's University of Calabar second semester past questions in the Department of Educational Foundations and Administration. That's over 37 years ago. What's your take? Are the standards still the same today?
|
Hello, I am interested. I have sent you a DM |
Infotubia9ja:Yeah, I build full-stack web applications. And this is an example. I also handle maintenance too. |
The client confessed to have hired 3 different developers previously and yet they couldn't deliver the project. When I took it up was when I understood why the three previous guys couldn't handle it. I had to introduce in my own logic to make things work. Today, it's about 98% complete. Though it's not yet hosted on a live server. I used Laravel, TailwindCSS, Livewire and AlpineJs. Please hire me for your next gig. 😉😉
|
ovanda:Welcome Victor |
Greydebz:Welcome Debby |
Murpheus009:Nice meeting you here |
It still doesn't hurt to follow the device's manual. The manufacturer knows better |