Comments (11)
It looks like a problem in either your routes file or client side not using the right method.
Could you post a sample of the client request and route file section?
Are you using the api.php or web.php file?
from valet-linux.
in routes/api.php
Route::post('/test', function(){
return "everything seems fine";
});
trying to access integrations.dev/api/test
and I receive:
MethodNotAllowedHttpException in RouteCollection.php line 233:
from valet-linux.
How are you testing the endpoint? I just tried your example with postman but could not reproduce it. I can only see that exact error when using the wrong HTTP verb.
from valet-linux.
Please update to the latest version.
from valet-linux.
I updated but now nginx is not starting:
$ valet status
Php7.0-fpm is running...
Nginx is stopped...
from valet-linux.
Ok, it appears that /etc/nginx/nginx.conf had one semi colon thet it should not be there.
But, POST requests are still not working.
from valet-linux.
Thanks for pointing out the double semicolon, it is now fixed. Does the problem show up in Laravel Homestead?
from valet-linux.
I don't use homestead...
But the issue with POST, it is something in valet or within my application?
from valet-linux.
I'm almost sure it is with the application, that's the reason I asked you to test it in Homestead. I don't know the tool you used to test the API but as you can see in my screenshots it works just fine in my Valet installation.
from valet-linux.
MethodNotAllowedHttpException
indicates that a route doesn't exist for the HTTP method you are requesting. If you have a POST
route set up, you can't access it directly from the browser, since it performs a GET
request. If you can't reproduce the test as shown by @cpriego, you can simply set up a form on a GET
route forwarding to the POST
route using the action method (remember to include {{ csrf_field() }}
inside form tag, more info here).
from valet-linux.
Closed by inactivity
from valet-linux.
Related Issues (20)
- Bug: Cannot install version greater than 2.2.32
- Bug: Valet x VPN (NordLayer) HOT 2
- Bug: Can't install on Arch Linux HOT 10
- using valet share HOT 4
- Intermittent fails in GitHub Actions HOT 4
- Bug: phpmyadmin errors on php 8.1 HOT 1
- Bug: Valet installation fails on Fedora 37 HOT 7
- Bug: valet share not working HOT 2
- Pacman was unable to install [php8.2-fpm] HOT 1
- Bug: Update loop HOT 1
- Bug: Bad Gateway because valet.sock is not created HOT 6
- Ask: Remove dot [.] on php version HOT 4
- How to increase req timeout in valet ?
- CA Certificate folder/file not exist on Ubuntu 22.04
- Bug: Problem with valet-linux proxy operation HOT 1
- Valet Stop throws an error DomainException: Unable to determine PHP service name HOT 4
- Bug: RedHat/Fedora based systems long boot time. Systemd valet-dns.service network wait online issue. HOT 4
- Bug: Issue with php8.2-fpm package name. HOT 6
- Bug: When connecting to Mullvad (VPN) all DNS requests fail HOT 1
- Bug: Can't using PHP 8.3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from valet-linux.