Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Illuminate/Foundation/Console/ServeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,17 @@ public function fire()
{
chdir($this->laravel['path.base']);

$host = 'localhost';
if ($this->input->getOption('any-host') === true)
{
$host = '0.0.0.0';
}

$port = $this->input->getOption('port');

$this->info("Laravel development server started on port {$port}...");
$this->info("Laravel development server started on {$host}:{$port}...");

passthru("php -S localhost:{$port} -t public server.php");
passthru("php -S {$host}:{$port} -t public server.php");
}

/**
Expand All @@ -43,6 +49,7 @@ public function fire()
protected function getOptions()
{
return array(
array('any-host', null, InputOption::VALUE_NONE, 'Binds server to 0.0.0.0 for open access'),
array('port', null, InputOption::VALUE_OPTIONAL, 'The port to serve the application on.', 8000),
);
}
Expand Down