Basic components


Entrance to the Larravel application: Basic Introduction to Routing Series

Basic route The most basic Laravel route only receives one URI and one closure, and provides a very simple and elegant route definition method based on this: Rou...

Published by Xueyuan Jun 6 years ago    Views: 87750    Number of likes: 90

Entrance of Laravel application: Parameters, naming and grouping of routing series

Routing parameters Required parameter Sometimes we need to get the URI request parameters in the route. For example, if you want to get the user ID from the URL, you need to define the routing parameters in the following way

Published by Xueyuan Jun 6 years ago    Number of views: 84805    Like: 53

Entrance to the Larravel application: Routing Model Binding of Routing Series

Routing model binding When injecting a model ID to a route or controller action, you usually need to query the database to obtain the corresponding model data. The Laravel routing model binding lets the injection model

Published by Xueyuan Jun 6 years ago    Views: 63555    Like: 27

HTTP request filter: middleware

brief introduction Middleware provides a convenient mechanism for filtering HTTP requests entering applications. For example, Larave has a built-in middleware to verify whether the user is authenticated (such as

Published by Xueyuan Jun 6 years ago    Number of views: 84608    Like: 56

Use the middleware VerifyCsrfToken to avoid CSRF attacks

Introduction&Function Demonstration Cross site request forgery (CSRF) is a malicious vulnerability that attacks credit websites by masquerading requests from authorized users. Larravel Pass

Published by Xueyuan Jun 6 years ago    Number of views: 44967    Like: 35

HTTP request processing layer: controller

brief introduction Our previous demonstration examples all put all request processing logic in the closure function of the routing file, which is obviously unreasonable. We need to use the controller class to organize and manage relatively complex

Published by Xueyuan Jun 6 years ago    Views: 61873    Like: 19

HTTP request parameter acquisition, cookie setting and file upload

Access Request Instance To get the current HTTP request instance in the controller, you need to set the Illuminate Http Request class in the constructor or method

Published by Xueyuan Jun 6 years ago    Views: 81666    Like: 20

HTTP response, redirection and file download

Create Response String&Array All routes and controllers will return a response sent to the user's browser after processing the business logic. Laravel provides

Published by Xueyuan Jun 6 years ago    Number of views: 42546    Like: 20

Larravel view rendering: Blade template engine

Blade Introduction Blade is a very simple but powerful template engine provided by Laravel. Unlike other popular PHP template engines, Blade

Published by Xueyuan Jun 6 years ago    Number of views: 67001    Like: 27

Creation and data transfer of Larave view

Create View The view contains the HTML code of the application, and separates the controller logic and presentation logic of the application. View files are stored in resources/views

Published by Xueyuan Jun 6 years ago    Views: 32334    Like: 11

Auxiliary Functions: Request URL Generation

brief introduction Laravel provides several auxiliary functions to help us generate URLs in applications. These functions are mainly used to build links in view templates and API responses, or

Published by Xueyuan Jun 6 years ago    Views: 29342    Like: 12

Session Implementation, Configuration and Use Details

brief introduction Because the HTTP protocol itself is stateless, and the last request is not associated with the next request, we introduce a session to store user request information to solve the problem

Published by Xueyuan Jun 6 years ago    Views: 63011    Like: 11

Request form validation and error handling

brief introduction Laravel provides several methods to validate the request input data. By default, Larave's controller base class uses Valid

Published by Xueyuan Jun 6 years ago    Views: 94615    Like: 16

Exception handling&error log

brief introduction Laravel has configured error and exception handling for us by default. We will trigger an exception in the App Exceptions Handler class and

Published by Xueyuan Jun 6 years ago    Number of views: 38389    Like: 15

search result