langsari / the-noble-quran

Quran Web Application
MIT License
6 stars 31 forks source link

mvc in laravel #79

Open langsari opened 2 years ago

langsari commented 2 years ago

Where is M V and C inside the laravel framework

langsari commented 2 years ago

m is about database that use to dealing with seed, factory. We use up and down function to migrate the database structure

langsari commented 2 years ago

Screen Shot 2021-09-21 at 14 39 17

DantonMariano commented 2 years ago

HI @langsari, i hope you're doing well, MVC stands for Model, View, Controller architectural pattern, you may find your Models inside your App folder, your Controllers inside app/HTTP Folder, and your views are going to be inside your resources,

Your Models will pretty much deal with all Database queries, i recommend you learn how to use Laravel's Eloquent ORM because it makes things a lot more simpler and intuitive by just modelling your Database table onto a model from otherwise just using the Query Builder or just plain simple SQL for everything inside your application, Your Controllers will deal with all the Logic of your Laravel app, where you'll be receiving input from the user and inserting or querying it in the Database, Fetching, Deleting, pretty much where the heart of your application resides. Your Views work by Using a template engine and dinamically rendering data fetched from your controllers on the website, Laravel uses the Blade directive for templating.

That is, if you're using Laravel in a fullstack environment, otherwise if you're just using it for Back-end purposes i'd recommend you take a look on Restful API's and some front-end framework to make working more intuitive and productive.

langsari commented 2 years ago

HI @langsari, i hope you're doing well, MVC stands for Model, View, Controller architectural pattern, you may find your Models inside your App folder, your Controllers inside app/HTTP Folder, and your views are going to be inside your resources,

Your Models will pretty much deal with all Database queries, i recommend you learn how to use Laravel's Eloquent ORM because it makes things a lot more simpler and intuitive by just modelling your Database table onto a model from otherwise just using the Query Builder or just plain simple SQL for everything inside your application, Your Controllers will deal with all the Logic of your Laravel app, where you'll be receiving input from the user and inserting or querying it in the Database, Fetching, Deleting, pretty much where the heart of your application resides. Your Views work by Using a template engine and dinamically rendering data fetched from your controllers on the website, Laravel uses the Blade directive for templating.

That is, if you're using Laravel in a fullstack environment, otherwise if you're just using it for Back-end purposes i'd recommend you take a look on Restful API's and some front-end framework to make working more intuitive and productive.

Thank you for your kind valuable recommendation, We trying to implement a full-stack env using Laravel for this project. Routing, MVC, Eloquent ORM with MySQL, Blade for templating engine, may implement integrated API with other system.