-1

Is there a way to use slugs in my routes like instead domain/technicalInformation it would be domain/technical-information. Thank You!

PagesController.php

class PagesController extends Controller
{    
    public function technicalInformation(){
        return view('pages.technical-information');
    }
}

web.php

Route::get('/technicalInformation','ConsumerController@technicalInformation')->name('technical-information');
Play Free
  • 93
  • 1
  • 11
  • you may need to show us some more code, is `technical-information` from your db? – Andy Song Aug 14 '20 at 03:08
  • No, `technicalInformation` is a function used in my controller. I read some docs about slugs, does it uses a db? I am not using slugs right now – Play Free Aug 14 '20 at 03:11

1 Answers1

2

Well you just change to this and it should work.

Route::get('/technical-information','ConsumerController@technicalInformation')->name('technical-information');
Andy Song
  • 4,404
  • 1
  • 11
  • 29