-3

I'm new to using laravel packages and I always code following MVC in mind, regardless what functionality it is, it will always follow the MVC pattern. All route related goes to web.php (for web), all application logic goes to Controllers folder as controllers and any database logic to Models as models.

In this sense, its easy to find and trace the code within the application especially when its someone else's code.

In Laravel 11 Fortify, (for me) things get messy in a way that the codes follow a different convention which is not MVC. Its weird for me that the framework promotes MVC development yet the packages or scaffold library (UI) doesn't follow such pattern. I need help to understand this.

7
  • MVC is not silver bullet and logic in controllers IS NOT mvc. Commented May 23, 2024 at 9:46
  • Are you contributing to the package, do you need to make changes to the source of Fortify? Commented May 23, 2024 at 9:55
  • 1
    Fortify is a headless (no UI) authentication package that is completely agnostic of how you implement the UI that interacts with it. That level of abstraction is what makes the package so flexible, it makes no assumptions about your implementation. I question that the lack of the MVC design pattern is what is preventing you from easily debugging your code. Commented May 23, 2024 at 10:21
  • @Peppermintology thats what doesn't make sense for me. For example, in the documentation, Routing by default are defined in the route files which are located in the route directory. So by laravel nature, routes, regardless of the developer coding approach, should be in routes folder. But using Fortify (as an example), doesn't follow laravel "by nature" pattern, instead it introduces its own coding pattern. Commented May 23, 2024 at 10:32
  • 1
    Don't look at it as introducing a new coding approach but rather removing any opinions. Fortify allows complete control over the authentication workflow, you can customise almost every point of it if you want or need to. If you want to just scaffold something out using Laravel conventions, consider Breeze or JetStream. Commented May 23, 2024 at 12:08

1 Answer 1

-4

Laravel is not MVC.

Read the Laravel documentation carefully. "MVC" never appears.

Model

  • Laravel: Database/Eloquent
  • MVC: Everything except VC

They use the same words but have different meanings.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.