Welcome Guest, Not a member yet? Register   Sign In
Additional access points on RESTful resource
#1

Hi
I am creating a RESTful API in Code Igniter 4.

The resource route provides routes for: index, show, create, update, delete.

Currently, index gets all items by ID. Show gets 1 item by ID.

How can I create another access point to get an item by its name instead of by the ID?

I will need to be able to search for items by name or ID.

Any ideas?
Reply
#2

Add a method for it in your controller.
Add a route for it.

I recommend you try the official tutorial.
https://codeigniter4.github.io/CodeIgnit...index.html
Reply




Theme © iAndrew 2016 - Forum software by © MyBB