Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the disadvantages of laravel

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the shortcomings of laravel, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.

The shortcomings of laravel framework are: 1, component-based framework, relatively bloated; 2, the framework is large, less efficient than small frameworks such as yaf; 3, the framework is more complex, slow to get started than the general framework, and the learning cost is high.

The operating environment of this tutorial: windows7 system, Laravel6 version, Dell G3 computer.

Laravel framework

Laravel is a concise and elegant PHP Web development framework (PHP Web Framework). It frees you from the noodle-like clutter of code; it helps you build a perfect web APP, and every line of code can be concise and expressive.

Advantages

Rich in documents

A large number of third-party open source libraries

Complete security mechanisms (form validation, etc.)

Middleware and routing filter and control access to avoid illegal requests

Error handling mechanism is friendly

Support for composer package management tools

A collection of relatively new features of php and various design patterns.

Disadvantages:

Component-based framework, relatively bloated

Performance will be less efficient than small frameworks such as yaf

It is more complex, the start-up is slower than the general framework, and the learning cost is high.

Benefits of using the Laravel framework

If the above sounds interesting enough to encourage you to use the framework when developing your next application, let me share some of the advantages of the Laravel framework over other PHP frameworks. These advantages undoubtedly make the Laravel framework one of the main competitors for the best PHP framework.

1. User authentication out of the box

The Laravel framework provides user authentication out of the box. Any modern web application requires user authentication, and with the Laravel framework, you hardly need to do anything to set it up. When you set up user authentication, the Laravel framework creates all the important components, such as the user model, registration and login controller, and the corresponding views. And in the future, it will be very easy to extend these components to the newly added functionality based on the business logic required by the application.

In addition, the Laravel framework also provides Socialite package (extension package), which enables your application to authenticate users using a variety of social networks such as Facebook, Google Plus and Twitter. To make it work properly, you only need to make a minimum configuration.

two。 Convention over configuration (also known as programming by contract)

The Laravel framework also uses the "convention over configuration" approach. This basically means that if you follow the naming conventions of different components, you don't have to pay attention to the configuration. If you follow the naming convention, the Laravel framework itself will help you with a lot of low-level details, and everything will magically start to work. If you have been using traditional PHP programming, this may be unbearable at first. But once you get a taste of it, you never want to look back.

3. Easy-to-use email function

It's hard to imagine a modern application without email. Using the Laravel framework, it is very easy to implement e-mail delivery. In addition to SMTP and Php mail capabilities, the Laravel framework supports a variety of e-mail notification services, such as Mailgun,Mandrill,SparkPost,Amazon SES,SendMail, and so on. These services allow you to quickly start sending emails through local or cloud-based services. You can also use Nexmo to send notifications via Slack and SMS. All of these services are available out of the box in the Laravel framework.

The Laravel framework also supports Markdown in email templates, which allows you to create emails in very little time. Markdown is a text-to-HTML (text-to-HTML) conversion tool.

4.Artisan command

Personally, the Artisan command line is the most concise and useful feature provided by the Laravel framework. Artisan is the command line interface of the Laravel framework that helps developers automate many tasks using the command line itself. The Artisan command can be used in the application itself, and developers can create additional Artisan commands.

For all the common tasks you can think of, you can find an Artisan command that corresponds to it. For example, create a model, create a controller, create a database seed, migrate a database, and so on. This list is endless. I call it "concise" because all you have to do is pass commands and leave the rest of the work to the Laravel framework.

5. Test automation of "test-driven development"

The Laravel framework comes with support for PHPUnit, which makes it easy to test PHP applications using the "test-driven development" mode. It's easy to write unit tests for your application, and make sure things work the way you want them to.

6. Concise dependency injection

Once you start working with the Laravel framework, you will soon realize that the Laravel framework is inspired by Ruby on Rails and more functional languages than from Java. This can be easily seen in the way the Laravel framework handles dependency injection. Although implementing dependency injection can take a complex pattern, the Laravel framework takes the opposite approach, providing an easy way to create global helper functions. With the help of global functions and Faade static proxies, we can easily implement dependency injection wherever we need it.

7. Separation of business logic and display code

Laravel follows the model-view-controller (MVC) architecture pattern, separating business logic from view. This method has many advantages. To really understand its advantages, you need to understand what the MVC pattern is and whether your application needs such an architecture.

8. Eloquent ORM (object-relational mapping) implementation

Eloquent is an implementation of ORM (object-relational mapping) provided by Laravel. For more information, refer to the link in Wikipedia (https://en.wikipedia.org/wiki/Object-relational_mapping). Eloquent makes it very easy to get data from a database. It is also easy to create relationships between tables and get data from those tables. Eloquent also allows you to create various connections in tables and provides many helper functions to make it very easy to interact with the database. You hardly need to write SQL queries or functions. Because the Eloquent ORM,Laravel framework provides out-of-the-box support for the following databases:

MySQLPostgreSQLSQLiteSQL Server you're absolutely right, which basically means that as long as you use Eloquent, you don't have to worry about compatibility with any of the above databases. Switching from one database to another is also very easy. Now try to imagine the scalability this brings to your application. Let me explain this with an example. Suppose you have an application that starts with a small user base. Because of the small number of users and the initial stage of the application, you decided to use MySQL as the database. After a while, the number of users of your application has grown to a fairly high level, and now you may need to switch to the SQL Server database. Because of the use of Eloquent, this switch is now as easy as changing specific configuration details in the Laravel framework.

9. Queue (Queue) and scheduler (Scheduler)

When developing an application, there are usually time-consuming tasks. These tasks need to be deferred to a later time so that they do not block the user's process. A perfect example of such a task might be to generate a PDF report that counts user requests to create CSV files. The queue service of the Laravel framework provides a unified API for deferring these tasks to a later time in the application.

When it comes to the command scheduler of the Laravel framework, it is the perfect substitute for those tedious scheduled tasks (Cronjob). In many cases, developers must set up scheduled jobs for specific tasks. A perfect example of such a task is to send a weekly Newsletter of their subscriptions to all subscribers. In order to set up this scheduled job, the developer must log in to the server using the SSH command and set the scheduled job at the operating system level. This can be a problem for a while, because these scheduled jobs cannot be part of the management of GIT and other version control systems. But the Laravel framework's command scheduler uses built-in functions to provide a clean API to schedule a variety of tasks. In this way, you do not have to log in to the terminal of the server using the SSH command, and all these scheduled jobs become part of the code and fall into the scope of version control system management.

10. Concise routing

The Laravel framework handles routing in a simple and intuitive way. There is a single web.php file that handles all web routes. If some routes require common middleware, they can be easily grouped in Laravel.

A perfect application scenario for routing is that certain pages in the application require user authentication before the user can view them. The Laravel framework can group all these pages and check them with Auth middleware to ensure that only users logged in to the system can view them. The Laravel framework also provides a concise routing model binding (route model binding), where the model (model) can be bound to a route. With this help, the view can be returned directly from the route itself without even having to access the controller.

11. Composer manages dependencies

The Laravel framework uses Composer to manage dependencies and automate loading. Composer can help you install the Laravel expansion pack, which makes dependency management easy. At any time, you can check the package.json file to see all the dependencies that your application is using. Composer also allows you to update dependencies with a single Composer command.

12.Blade template engine

Blade is the template engine for the Laravel framework. Blade gives you a head start in separating the view from the business logic. It keeps your view code very clean. Once you have a clear understanding of the MVC architecture pattern and Laravel's implementation of it, you will more clearly understand the importance of the Blade template engine. Blade also provides template inheritance, so you can divide the recently used template into multiple parts and let other view files inherit those parts. With the help of Blade, you can create some view parts with less logic, and then you can include these small parts to form a complete view.

13. Document

This is a bit of a gray area. When I first started using the Laravel framework, I did have a problem finding documents. Everything was undocumented at the time, but at some point I suddenly realized that something began to work miraculously, and that was the moment when people began to follow the naming convention. Now, there are some API documents that list each class and method declared in the Laravel framework. Once you know how to use it and how to use Laravel documents for your benefit, I'm sure you won't have any more complaints.

14. Active community

Laravel does have an active community. When you encounter any problem, you can search, and you will certainly find a lot of StackOverflow posts that address your problem. In addition to having an active community on StackOverflow, there is a discussion forum called Laracast. You can sign up for free as part of the Laracast forum and community, which is now very active.

I think these advantages are enough to get you excited about the Laravel framework. Although it is certainly an exaggeration to define it as perfect, I am sure that the Laravel framework is definitely one of the best PHP frameworks.

Thank you for reading this article carefully. I hope the article "what are the shortcomings of laravel" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report