Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Konstruktionsplan's avatar

RMB ➕ Postman

Hello world.

I would like to update a blog. Since I am working with Route Model Binding, I am wondering how to pass a blog object into Postman.

There I have the possibility in the route something like "blogs/1" with a PUT request, but of course this will not work.

Does anyone have some advice on this?

Thanks. ✨

# api.php
Route::apiResource('photos', PhotoController::class);
0 likes
8 replies
Konstruktionsplan's avatar

@Sinnbeck

Thank you, but I already understood that. The "blogs/1" was as an example of why it SURELY can't work.

I understood the route model binding and I am looking for a way to make the app calls via Postman.

Sinnbeck's avatar

@Konstruktionsplan you just call the url with blogs/1 and laravel will find the blog with id = 1 (if you set laravel up correctly). This has nothing to do with postman

Konstruktionsplan's avatar

@Sinnbeck

Okay. Maybe we misunderstand each other or you don't know what Postman is. I would explain it briefly:

Postman is a software with which I can call routes, like from Laravel, with "POST", "GET" etc. This is what you use when you want to test API routes. :)

I need to pass a blog object via Postman to the route blogs/{blog}. The placeholder for this must of course be the blog I want to update.

Sinnbeck's avatar

@Konstruktionsplan I know very well what postman is.

What I am telling you is that the {blog} in blogs/{blog}, isn't an object. It is just an ID (or whatever you are binding to)

Lumethys's avatar

@Konstruktionsplan if im not mistaken, you want to CREATE NEW or UPDATE a blog, no?

then you must provide the attributes in the body just like a form request

Konstruktionsplan's avatar

Hello friends! ✨

I have now experimented a little. It works now halfway. I am now trying to make a PUT request, however I am told that "title" and "body" are mandatory. Which is correct, since I require it in the request class as well.

So to understand:

  • title and body are required
  • I give via postman the form-data title and body to the update-route with the request PUT.

Still it tells me that it is required. Apparently it can't receive that from postman?

Thank you very much!

Please or to participate in this conversation.