How to organize and implement Laravel5.1 three-tier structure directory

WBOY
Release: 2016-08-08 09:07:01
Original
1277 people have browsed it

As the title says, I have been learning laravel recently, but I found that many video tutorials only talk about the directory structure of Model and Controller, but I think it is easier to manage and maintain with Dao and Service similar to Java, but I don’t know how to organize it as a newbie. , and I plan to apply Laravel to my new project, does anyone know about it

Reply content:

As the title says, I have been learning laravel recently, but I found that many video tutorials only talk about the directory structure of Model and Controller, but I think it is easier to manage and maintain with Dao and Service similar to Java, but I don’t know how to organize it as a newbie. , and I plan to apply Laravel to my new project, does anyone know about it

Because the tutorial is just a code example and does not involve complex business logic.

PHP is currently not the best solution for large-scale projects. The main purpose is to be short and fast, so MVC is basically enough, and related logic processing is generally integrated into the Model layer.

If your business logic is quite complex and you don’t want the Model class to expand too much, you can also separate the business logic. It is generally recommended to create a related Repository class. The tutorial is here: https://laravel.com/docs/5.2 /...

PS: Code organization is all about finding a balance among changes, so it is still important to have an IDE for reconstruction

I also created related Repository

Reference: https://github.com/bestmomo/l...

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template