6
votes

My IDE is phpstorm and running on WAMP Server. While coding, it does not show the expected response, always returns the previously requested response (In postman). Each time, I need to close 'php artisan serve' with CTRL+C and then run again to get the expected response.

I tried changing IDE, changing port but it does not work. Of course, I tired to save manually ( CTRL+S) but the problem persists.
I also tried the following commands:

php artisan cache:clear
php artisan config:clear
php artisan route:clear
composer dump

But the problem still persists.

2
If you have wamp then why are you using php artisan serve ? use php artisan serve --port 8080 to run it on another port. - Sasan Farrokh
I tried different ports except 8000 but the problem persists. - Masiur Rahman Siddiki

2 Answers

1
votes

The issue might be the composer command. Please, have a look on my setup in the Makefile:

run:
    php artisan config:cache
    php artisan config:clear
    php artisan cache:clear
    composer.phar dump-autoload -o
    php artisan serve

And it's ready to go with a Laravel's "clean build".

0
votes

Can you try with a diferent request tool, like doing a GET on your browser? Or just create a new endpoint to test that. This way you make sure that changes are being saved.

I recommend you make tests to see if:

  1. the problem is on your postman (a cache maybe?);
  2. the problem is that your code isn't being saved;
  3. the problem is on your local server (a persistent cache?);

My tip is: Try to eliminate the possible causes and you should achieve an answer.

Let´s try to make sure about above items and if them are ok, we check possible another ones.