NewStats: 3,263,810 , 8,181,471 topics. Date: Sunday, 08 June 2025 at 02:28 AM 4t2n1h6n613r |
(1) (2) (of 2 pages)
![]() |
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 , the () method will handle registration logic. The () method will check if the details the entered are correct or not. If correct, the will be logged in, otherwise, the 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 s. The show_single_post(identifier) method will handle fetching a single topic based on the identifier that has been ed 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. () 2.() 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. : This guy presents the registration form that the should fill in order to . 2. : This guys displays the form. 3. create-topic: This guy presents another form for a 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 , that means we need to store their information somewhere. , our "somewhere" is called the database. The first Model we will need is the model to store s 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 , 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 s to 2. We want s to be able to 3. We want to have categories/sections 3. We want s to be able to create topics in a particular section/category 4. We want to store the topics that s 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. 1 Like 1 Share |
![]() |
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 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 makes a request to view another '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 s (let's use s π). 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 s 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 . 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. 15 Likes |
![]() |
I stumbled upon my late Uncle's University of Calabar second semester past questions in the Department of Educational Foundations and istration. That's over 37 years ago. What's your take? Are the standards still the same today? 10 Likes 2 Shares |
![]() |
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. 1 Like |
![]() |
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
10 Likes |
![]() |
MindHacker9009:Thank you for this! It's better this way. It's my time and energy for goodness' sake. 1 Like 1 Share |
![]() |
Nipeks: Well, you're entitled to your opinion. But I'd rather present a range of prices to give my potential clients options. I don't have to tailor down my services based on a client's budget. It won't speak well of me if it turns out poorly. Not because of my incompetence, but because of client's budget. |
![]() |
You're assuming your potential client will be technically inclined to know all these?? If they have the technical knowledge, they probably won't you. It's your responsibility to break down everything and give them price options. Nipeks: |
![]() |
MindHacker9009:Exactly... Give the client options based on what you know. Not to ask a client their budget. It doesn't make any sense at all. 1 Like |
![]() |
Nipeks: Not entirely true. If a client gives you a specification of what they want in the project, the onus lies on you to give a price range. If they accept to pay after negotiating, then you've won the project. But asking for a budget and then delivering the project based on their budget doesn't speak well of you. People will see the project and judge it based on what they see. If a project is poorly done due to the client's budget, people will conclude that you as the developer lack the skills and aren't professional. They won't ask the budget. I have politely declined several projects not because I didn't want the money. But because the money is not worth the energy I'll put in to make the work perfect. I can't just deliver a project for the money of it. I love doing good things. |
![]() |
Wb21:Thank you. You really nailed more on my points above. It's just sad how new and inexperienced developers feel making money entails outsmarting potential clients. 1 Like |
![]() |
I've seen this trend among developers/designers and almost everyone in the tech space. When approached with a gig/job, instead of mentioning what they will charge for it, they end up asking the client questions like: "What is your budget?", "How much do you want to pay?", etc. In my opinion, questions like these mostly come from non-professionals. A professional who knows their worth, values their time, energy and resources -- will be straight to mention what they want to charge for a project. You know better for goodness's sake. You're in the know of what the project will cost because you know what is involved. It's your skills that will be put to use! It's better you mention your price and then let the client negotiate their way through. The question: "what's your budget" presents you as being open to any offer. Only hungry and desperate developers do that. Stop it and be professional. 1 Like 1 Share |
(1) (2) (of 2 pages)
(Go Up)
Sections: How To . 100 Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland. |