Undefined function link_to in Laravel 5

Paul Kitutu picture Paul Kitutu · Feb 26, 2015 · Viewed 8.2k times · Source

I was trying to create a view in Laravel 5, I used the function link_to to create some html link but to my dismay; I got an error as below:

FatalErrorException Call to undefined function link_to()

Was this function removed? I know the alternative is to write the actual HTML as <a href='url'>Label</a> but I would prefer to use some function like link_to('url','label');

Answer

crynobone picture crynobone · Feb 26, 2015

link_to is actually illuminate/html helpers which you need to add manually using composer require "illuminate/html=~5.0" or convert to use url() instead.