Skip to main content
added 74 characters in body; deleted 17 characters in body; added 129 characters in body
Source Link
Leo
  • 7.4k
  • 5
  • 28
  • 48

you can check url segments using segment() helper something like:

if(Request::segment(1) ==='aboutus') { //doreturn someredirect(route('your logicother route'); } if(Request::segment(1)==='privacy') {   segment return redirect(route('your other route');  } 

You can add that check in your middleware, segment() expects an integer param like in case above 1 will check first wildcard after domain name.

you can check url segments using segment() helper something like:

if(Request::segment(1) ==='aboutus') { //do some logic } segment() 

expects an integer param like in case above 1 will check first wildcard after domain name.

you can check url segments using segment() helper something like:

if(Request::segment(1)==='aboutus') { return redirect(route('your other route'); } if(Request::segment(1)==='privacy') {    return redirect(route('your other route');  } 

You can add that check in your middleware, segment() expects an integer param like in case above 1 will check first wildcard after domain name.

Source Link
Leo
  • 7.4k
  • 5
  • 28
  • 48

you can check url segments using segment() helper something like:

if(Request::segment(1) ==='aboutus') { //do some logic } segment() 

expects an integer param like in case above 1 will check first wildcard after domain name.