Skip to content
Advertisement

Laravel question, How to use _GET on Blade

I have a question that I cant solve at this moment.

I have and URL like this: https://www.example.com/schedule/2020-02-26

i put the date on the URL with the next function:

JavaScript

In this example $datevar is equal to “2020-02-26”

My question is, How can I show the $datevar in my blade? Im trying with {{$datevar}} but I get an error.

To put the datevar on my function I use and other function as Request:

JavaScript

Thanks for your help

Advertisement

Answer

The solution is to register the URL format in the web.php file. In that file, add this line:

JavaScript

Now, whenever the the controller method is called, it’ll pass the date as an argument to your addnewdate method, which you need to restructure like this:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement