Set port for server in Laravel

In Laravel usually when we do php artisan serve command the folder will get served in localhost:8000 automatically.

What is the command to set a different port for our folder? Let’s see.

Suppose you want to develop two projects and both use different ports one uses 8080 and one uses 8080.

For running a project in port 8080 the command is :

php artisan serve --port=8080

if you want that project to run in port 8080, run the below command:

sudo php artisan serve --port=80