Skip to content
Advertisement

Laravel Views Subfolders routing

I have sub folders inside my view folder called

--views
 ---saledata(folder)
   ----saled.blade.php
 ---uploader(folder)
   ----datauploader.php
 ---home.blade.php

I want to route this saled.blade.php and datauploader.php files in web.php

I have tried with

route:: view('saledata','../saledata/saled');
route:: view('datauploader','datauploader');

in both the ways.but both shows 404 errors.

and this is the way I mentioned the url of the file in home.blade.php

 <a href="{{ url('saledata') }}" title="">

So please help to resolve this

Advertisement

Answer

if directly form the web file :

Route::get('saledata', function () {    
    return view('saledata.saled');
});

if want to use in the controller:

public function index(Request $request) {
    return view('saledata.saled');
}
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement