Hi, I have just published “Laravel 5.7.*: Middleware, Authentication, and Authorization Explained”. This book is 60% complete and I am currently working on it. Download your free copy and give valuable feedback.
Laravel comes with many stunning features. One of them is definitely database migrations. In the next chapter we’ll discuss about migration in detail.
Before that we need to understand our environment properly. What is environment in Laravel? If you look at the document root you will find an ‘.env’ file. It basically says about the database connections. Where would we get that default database set up file? In the ‘config’ folder, we have a ‘database.php’ file. Open it up and see the content.
As a beginner you may want to get a basic idea about how MVC or Model-View-Controller framework works.
Primarily in the Model part we keep our application or business logic and through this logic we access data working on it further – adding, editing or deleting.
View is the part where presentation layer lies. It presents a view to the users. I think I need not elaborate. You know what I mean.
Now the question is: what is the function of controller? Actually controller is the transporter. It acts as a bridge between model and view. It manages the communication between model and view. When you send a form on a web page, what happens? In the background, the controller actually accepts the inputs and converts it into commands for model. Once the inputs have been processed in model it again calls the controller to render it to view.