Complete Reference of view in Laravel

What is View?

Views contain the HTML served by your application and separate your application logic from your presentation logic. Views are stored in the resources/views directory.

Creating View

resources/views/aboutme.blade.php

Create Route for View

Syntax:-

Route::get(‘uri’, function(){return view(‘view_name’)});

Example:-

Route::get(‘about', function () {
    return view(‘aboutme');
});

If your route only needs to return a view, you may use the Route::view method.
Syntax:- Route::view(‘uri’, ‘view_name’);
Example:- Route::view(‘about’, ‘aboutme’)

Amardeep Dubey
Latest posts by Amardeep Dubey (see all)
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x