Created new route for 404 page

This commit is contained in:
jitendra 2019-04-23 12:43:42 +05:30
parent 9d65030779
commit b5c762b528
2 changed files with 9 additions and 6 deletions

View File

@ -33,13 +33,18 @@ use Webkul\Core\Repositories\SliderRepository;
*/
public function index()
{
if (request()->route()->getName() != 'shop.home.index')
abort(404);
$currentChannel = core()->getCurrentChannel();
$sliderData = $this->sliderRepository->findByField('channel_id', $currentChannel->id)->toArray();
return view($this->_config['view'], compact('sliderData'));
}
/**
* loads the home page for the storefront
*/
public function notFound()
{
abort(404);
}
}

View File

@ -275,7 +275,5 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
});
//customer routes end here
// Route::get('/{any?}', 'Webkul\Shop\Http\Controllers\HomeController@index');
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@index');
Route::fallback('Webkul\Shop\Http\Controllers\HomeController@notFound');
});