Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: URL::to('/') port number for localhost not included in db seed files

I am running a local server on port 4567. I am trying to make it so that when my database seeds I save a reference to the home page on my site in my db. However I noticed when I run URL::to('/') in my seeds it only includes "localhost" without the port, but if I include it in my view code it comes out as "localhost:4567". Why is this? How can I fix it, if possibly, without writing if statement conditionals about what production environment I am in? Thank you.

Seed File result of URL::to('/')

http://localhost

View File result of URL::to('/')

http://localhost:4567
like image 224
applecrusher Avatar asked Jan 23 '15 07:01

applecrusher


1 Answers

Either set APP_URL in env file

APP_URL=http://localhost:4567

Or set url in config/app.php

'url' => env('APP_URL', 'http://localhost:4567'),
like image 54
Sachin Kumar Avatar answered Oct 06 '22 00:10

Sachin Kumar