Controller modification

phpclassroom007

Open the app / Http / Controllers / UploadController and make the following changes to it: So this is a fairly simple approach to saving downloaded files to disk. Here’s a breakdown of

Creating validation logic

phpclassroom007

Let’s modify the request stub to suit the needs of our application.┬áModify the file so that it looks like this: <? php namespace App \ Http \ Requests; use Illuminate \ Foundation

Generating a request

phpclassroom007

Before we go ahead and make a few changes to the generated UploadController stub, I think it makes more sense to create a request class first. This is because the controller method that

Why Laravel?

phpclassroom007

Around 2000, most PHP code was procedural and could be found in the form of “scripts” that would be a mess of spaghetti code. Even on the simplest pages, there was no separation of

URI Routing

phpclassroom007

Generally speaking, there is a one-to-one correspondence between URL strings and corresponding controller classes/methods. The content in the URI is usually in this pattern: However, in some cases, you may want to re-implicate

Use CodeIgniter library

phpclassroom007

All available library files are located in the system/libraries/ folder. In most cases, you need to initialize them in the controller before you can use them, as follows: ‘class_name’ is the name of the class

Model in Codeigniter

phpclassroom007

The model is optional for those who want to use the traditional MVC approach. What is a model The model is a PHP class, which is used to interact with the database. For

Controller in Codeigniter

phpclassroom007

The controller is the core of the application because it determines how to handle HTTP requests. What is a controller The controller is a simple class file, and its naming method can

Read News in Codeigniter

phpclassroom007

In the previous chapter, we learned the basic concepts of this architecture by writing a class that contains static pages. We have also reorganized the URI by adding custom routing rules. Now we start

Static Page in Codeigniter

phpclassroom007

Note: This document assumes that CodeIgniter and the document have been downloaded in your development environment. First, you need to create a controller class that can handle static pages. The controller class can help