Category: Laravel
-
Request
In this chapter, you will learn in detail about Requests in Laravel. Retrieving the Request URI The “path” method is used to retrieve the requested URI. The is method is used to retrieve the requested URI which matches the particular pattern specified in the argument of the method. To get the full URL, we can use the url method. Example Step…
-
Controllers
In the MVC framework, the letter ‘C’ stands for Controller. It acts as a directing traffic between Views and Models. In this chapter, you will learn about Controllers in Laravel. Creating a Controller Open the command prompt or terminal based on the operating system you are using and type the following command to create controller…
-
Namespaces
Namespaces can be defined as a class of elements in which each element has a unique name to that associated class. It may be shared with elements in other classes. Declaration of namespace The use keyword allows the developers to shorten the namespace. The default namespace used in Laravel is App, however a user can change the…
-
Middleware
Middleware acts as a bridge between a request and a response. It is a type of filtering mechanism. This chapter explains you the middleware mechanism in Laravel. Laravel includes a middleware that verifies whether the user of the application is authenticated or not. If the user is authenticated, it redirects to the home page otherwise,…
-
Routing
In Laravel, all requests are mapped with the help of routes. Basic routing routes the request to the associated controllers. This chapter discusses routing in Laravel. Routing in Laravel includes the following categories − Basic Routing All the application routes are registered within the app/routes.php file. This file tells Laravel for the URIs it should respond to…
-
Configuration
In the previous chapter, we have seen that the basic configuration files of Laravel are included in the config directory. In this chapter, let us discuss the categories included in the configuration. Environment Configuration Environment variables are those which provide a list of web services to your web application. All the environment variables are declared in the .env file…
-
Application Structure
The application structure in Laravel is basically the structure of folders, sub-folders and files included in a project. Once we create a project in Laravel, we get an overview of the application structure as shown in the image here. The snapshot shown here refers to the root folder of Laravel namely laravel-project. It includes various sub-folders…
-
Installation
For managing dependencies, Laravel uses composer. Make sure you have a Composer installed on your system before you install Laravel. In this chapter, you will see the installation process of Laravel. You will have to follow the steps given below for installing Laravel onto your system − Step 1 − Visit the following URL and download composer…
-
Overview
Laravel is an open-source PHP framework, which is robust and easy to understand. It follows a model-view-controller design pattern. Laravel reuses the existing components of different frameworks which helps in creating a web application. The web application thus designed is more structured and pragmatic. Laravel offers a rich set of functionalities which incorporates the basic…