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!
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.
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.
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.
You can use
php -S localhost:8080 -t public/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With