Another option for transferring data from the Controller to the View is to pass an object from the model class to the View. Remove the ViewData code and give the model class object to the return view. Import the model class binding object at the top of the Index View and use @Model to access the properties.
1 Using view()
2 Using with()
3 Using compact()
4 Using Controller Class.
The benefits of passing data from the controller to views include:
- Generating content that is personalized for each user;
- Improving application performance;
- Improving user experience;
- Creating a better experience for users as they interact with your application.
Passing data to a view is a way of passing data from the model to the view. This is accomplished by using the @ symbol before the attribute name in your model.
Learner's Ratings
4.5
Overall Rating
83%
3%
7%
3%
4%
Reviews
A
Abdul Sattar
5
Please update course
A
Ali Haidar
5
awesome
M
Muzammal
5
Best Experience Ever
J
Jatin
5
this tutorial help me to learn laravel ..
Outstanding Course
G
gautam metaliya
5
good experiance
B
bokhtiar toshar
5
Thank you so much,
A
Anuj Tyagi
5
Thank you so much. You are doing a good job and your way of teaching is very good.
M
mohit mistry
5
Sir, very good explanation in video but sir which screen recoder you used for making this kind of video???
R
RUPESH MISHRA
5
sir please make a video how to use bootstap in laravel without cdn link..
Share a personalized message with your friends.