Home > database >  Laravel Views Subfolders routing
Laravel Views Subfolders routing

Time:09-27

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

CodePudding user response:

In route file:

Route::view('/saledata', 'saledata.saled')->name('saledata');

And in url:

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

Hope it will works.

CodePudding user response:

Route::view('/','saledata/saled');

  • Related