Support the ongoing development of Laravel.io →
Database IOC Architecture
Last updated 2 years ago.
0

Kerry Jones,

Since the Item class is getting information from a table then it is a Model. Put this directly under the app directory.

As for the CompleteProtein class. Does it give output back to the user? For example does it make a query, manipulate that data and send the result to a page? If so this is an Controller. Put it under app/Http/Controllers/ But try to follow an example controller, especially the top declaration parts.

Any html produced by the CompleteProtein class should be done with view calls to blade templates.

You could also make a package of both of these if you wanted to keep the current layout. But that is only for things that need to be used by other systems or frameworks. And you can't change the layout.

Or you could namespace the classes put them in a new directory under app and call them directly. But you would still need a skeleton Controller. This is a bit more messy to maintain. Not really recommended.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

KerryJones kerryjones Joined 10 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.