“This is the 17th day of my participation in the First Challenge 2022. For details: First Challenge 2022.”

I think the Laravel framework is characterized by the use of container services; In addition, it brings together new features of PHP, provides support for various services out of the box, and applies various design patterns.

Architectural patterns

Laravel framework uses the development mode of service componentization, which consists of components composed by multiple service providers, and then provides different services by multiple components, and multiple services constitute projects.

The service provider is the core of the application configuration and is bound to the service container through the Register method.

Design patterns involved

Laravel framework uses a large number of design patterns, which greatly reduces the coupling degree between modules. Even better, the service container makes it easy to extend framework functionality and write tests.

Here’s a summary of the design patterns involved in the Laravel framework based on my previous article:

1. Appearance (facade) design mode

Design pattern -Laravel Request Practice: Elegantly set global variables

Laravel frames the most important Facades

2. Object-relational mapping mode

Eloquent I think is the most Eloquent ORM of all THE PHP frameworks. I’ve put together five articles about Eloquent, and you’re welcome to read them.

Eloquent Model use tips

1. Eloquent Modeling Tips

Eloquent Relational model usage tips

1. Advanced usage tips for relational models

Eloquent Usage tips for relational models

Contract design pattern

Details of Laravel Contracts

The factory pattern

The Laravel model factory class generates data in bulk

The strategy pattern

Laravel service container details

Observer model

Listening and triggering

Rapid development of

Laravel provides many out-of-the-box services for rapid development, such as data validation, queuing, caching, data migration, testing, artisan command line, etc., as well as powerful ORM, Artisan’s powerful command line tools, to achieve automation.

The characteristics of Laravel

1 Powerful REST Router: Can be called with simple callback function, quickly bind controller and Router

2 Artisan: Command-line tools that automate many manual tasks; Artisan is also a good helper for module testing and unit testing

Inheritable templates to simplify view development and management

4 Blade Template: Faster rendering

Eloquent I think is the best ORM tool to use

6 Migration: Manages the database and version control

7 testing is also powerful

8 Full Embrace composer

The Laravel framework introduces facade, dependency injection,Ioc patterns, and various design patterns

security

The security of the framework needs to be emphasized, and encryption must be mentioned when it comes to security.

Laravel’s encryption mechanism uses AES-256 and AES-128 encryption provided by OpenSSL. It is highly recommended that you use Laravel’s built-in encryption tools rather than any other encryption algorithm. All Laravel encrypted results are signed with a message authentication code (MAC) so that their underlying values cannot be changed again after encryption.

Laravel summary of key concepts

Service container

I think it’s the core design of the Laravel framework.

Is a powerful tool for managing class dependencies and performing dependency injection. The essence is to inject class dependencies into other classes through constructors or, in some cases, “setter” methods.

The facade

Provides a “static” interface for bound classes in the application service container

Advantages: Provides easy-to-test, flexible, concise and elegant syntax during maintenance.

contract

The format, method, parameters, etc. used to plan the service provider, and provide some constraints for the service provider.

reflection

It is mainly used to dynamically obtain the information of language components such as classes, instance objects and methods in the system. The dynamic acquisition and operation of these language components can be realized by transmitting API functions.

Late static binding

Classes used to refer to statically invoked classes in the scope of inheritance, that is, during class inheritance, the class used is no longer the current class, but the class invoked.

conclusion

The underlying design pattern of the Laravel service container, simple and efficient ORM support, combined with out-of-the-box services and support for security and scalability, is an elegant framework.

The last

Thanks for reading and welcome to like, favorites,coin(attention)!!