In this quick snippet, you will learn how to get the current route's parameter in your views using the blade templating engine!

Swap out PARAMETER_HERE with the specific parameter you need.

\Route::current()->parameter('PARAMETER_HERE')

A common use case for this would be to output specific content based on conditional logic.

@if( \Route::current()->parameter('account') === 'edit' )
     //Edit Account Form Here
@endif

Code Snippet By

Mike Biegalski


Biegalski LLC

Bio

A professional full stack developer, having experience in all aspects of the development cycle. Actively diving into new technology just to experience the workflow and see how it functions.

Submit An Article

We are open to accepting articles written by members of the community. If you have a quality article that you would like featured please, submit the article here.