Last Updated: February 25, 2016
·
1.956K
· matthewbdaly

Artisan task for running the PHP development server with Laravel

<?php

class Runserver_Task {

    public function run($arguments)
    {
        $port = !isset($arguments[0]) ? 8000: $arguments[0];
        echo 'Running PHP development server on port '.$port.'...';
        passthru('php -S localhost:'.$port.' -t '.getcwd().'/public');
    }
}
?>

1 Response
Add your response

Please note this was for Laravel 3 - Laravel 4 already includes a task for this

over 1 year ago ·