Nested View Directories

 Nested Blade Template | How to Open Nested Blade files in Laravel:

Views may also be nested within subdirectories of the resources/views directory. "Dot" notation may be used to reference nested views. For example, if your view is stored at resources/views/admin/profile.blade.php, you may return it from one of your application's routes / controllers like so:

Syntax:

return view('admin.profile', $data);
Example:
 Route::get('/test', function(){
        return view('admin.profile'); // also use (.) & (/)
    });

O/P


Comments