Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command "serve" is not defined (Lumen-Laravel)

So, i try to install the lumen restful api. Based on tutorial, i have to "serve" on php artisan. The command be like:

php artisan serve sample_api sample_api/public

then it shows:

Command "serve" not defined.

Some say that serve command has been deleted in laravel 5 (which i use it). if so, what command should i use? or maybe find another tutorial?

Ps: Im a newbie :)

Thanks a lot!

like image 974
apapipip Avatar asked Mar 29 '16 03:03

apapipip


People also ask

How do I start a lumen server?

To start with, install composer and then change your directory to the root folder of the server. Create a lumen project “lumen_api” from the “laravel/lumen” package (packagist.org). The composer will create a folder “lumen_api” and install all files of lumen including dependency.

Why is my PHP artisan serve not working?

Reasons why php artisan serve not working You are running php artisan serve command in wrong directory. php artisan serve is laravel command only work with laravel project. Check project directory and run in root directory of your project. The requested host or port is not available.

What is lumen in laravel?

Lumen is an open-source PHP micro-framework created by Taylor Otwell as an alternative to Laravel to meet the demand of lightweight installations that are faster than existing PHP micro-frameworks such as Slim and Silex.


2 Answers

You can use

php -S localhost:8080 -t public/
like image 93
Oussema Chaabouni Avatar answered Sep 20 '22 21:09

Oussema Chaabouni


This command was removed from Lumen 5.2. You can use any other web server to run your app. I'd recommend to learn Homestead with built-in environment. If you're newbie, you can use something like WAMP.

like image 21
Alexey Mezenin Avatar answered Sep 17 '22 21:09

Alexey Mezenin