Laravel, api, postman - laravel

I am following a grafikart tutorial on the back-end of an API under laravel, but creating a comment module, and since yesterday I have this message why. I think that I come from a call or from a space name but I know ... on postman also it returns to me errors.
postman:
error message:

Add the model namespace to your call, make sure you have a method called allFor
$comments = \App\Comment::allFor();

Related

getting No such PaymentMethod: 'tok_1IPAGM4unAps2Hiagy7H655b' error message when im trying to update laravel 5.8 to 7 with spark

when I am going to update Laravel 5.8 to 7 and update dependencies like cashier, Laravel/spark-Aurelius . it's complete update but after registration with subcription it's shows an error No such PaymentMethod: 'tok_1IPAGM4unAps2Hiagy7H655b' .
this comes back with an paymentMethod: tak_
but i get an exception like below
https://i.stack.imgur.com/tLhPe.png
tok_1IPAGM4unAps2Hiagy7H655b is a Token, not a Payment Method. If Laravel Cashier is expecting a Payment Method, you'll need to change your code to either:
Change your backend code to create a Payment Method by passing in the token ID to card[token] (see https://stripe.com/docs/api/payment_methods/create#create_payment_method-card)
Change your client-side code to create Payment Methods using the Stripe.js createPaymentMethod function instead of createToken. You can see the differences between the two here: https://stripe.com/docs/payments/payment-intents/migration-synchronous#elements-step-1

Why Laravel reply 200 http code when MethodNotAllowedHttpException?

Why Laravel reply 200 http code when MethodNotAllowedHttpException?
I Would like to recieve a diferent code, like 500.
I consume laravel routes using angular or postman, and recieve 200 code and is dificult to deal with this.
Below one example:
This is not a error, but the usage of the dd() dump and die helper method. This will always return a 200.
Find all dd(); methods in your project and it should work and return a proper error code. But secondly due to that error being thrown, it could seem like your url is invalid and or not allowing POST calls.

MethodNotAllowedHttpException when using Route::delete

I don't know why I get this
I tested the route with
Route::delete("/attachments/{url}","TrixAttachmentController#destroyAttachment");
localhost:3000/api/v1/attachments?url=hDXtilCleTWc6WyiMeWpp9O0xIx3cRyJuEwVPxzL.jpeg
public function destroyAttachment($url){
dd($url);
}
still i get it
localhost:3000/api/v1/attachments?url=hDXtilCleTWc6WyiMeWpp9O0xIx3cRyJuEwVPxzL.jpeg
here ?url it shows it now using get request
call this route via delete method
can you show form
When using the Route::delete, the request is expecting a POST request with a method of DELETE.
If you are hitting the route in the browser using a GET request, this is the sort of error that will be thrown.
If you are calling the route in a browser you need to change that.
Make sure you are calling it on a form using DELETE verb.

{"status":false,"error":"Unknown method"} in codeigniter

I've managed to setup the REST ful API in my Codeigniter Application.name of controller and name of method are different but {"status":false,"error":"Unknown method"} error was display,how to solve?
Call the domain/index.php/controller/function without the "_get" .For example if your controller is called api and the function is users_get, use the address
localhost/domain/index.php/api/users.
That should work fine.

MethodNotAllowedHttpException with lucadegasperi/oauth2-server-laravel's included AccessTokenFlow POST route

This is my first Laravel project I'm on, and it has been a ton of fun so far.
I'm setting up an OAuth2 server. I have copied the code posted here in to my routes file.
Via this block of code...
Route::post('oauth/access_token', function()
{
return AuthorizationServer::performAccessTokenFlow();
});
I have tried doing http://local.server.com/oauth/access_token and a "MethodNotAllowedHttpException" error.
If there is any other information I could provide that would help you help me, please tell me!
Cheers
If you are typing http://local.server.com/oauth/access_token into the browser URL bar, then you are sending the request:
GET oauth/access_token
However, your route handles a POST request, and since there is no GET route defined, Laravel is responding with MethodNotAllowedHttpException
In order to properly test your route, you will need to send a POST request.

Resources