Welcome Guest, Not a member yet? Register   Sign In
Need help understanding the docs on RESTFul?
#1

I'm trying to get my head around the RESTFul part of the docs. But is confused as to where the individual parts go ...

It starts of by giving this example for setting basic routes:
Code:
$routes->resource('photos');

Now, where does this go? In the \App\Config\Routes.php file, or maybe in the (resource)controller itself? Please be specific. If it's the case it has to go into the Routes.php file, then this leads me to my next question ... does this 'port' well? If I have to scatter specific elements for specific controllers a bit here and a bit there, I guess it becomes 'unmanageable' in the long term and especially if an application becomes ever so slightly complex.

Wouldn't we need a way of somehow 'grouping' these things into a single place (thinking module here) somehow? So that, if moving 'modules' between applications we wouldn't have to 'remember' where we put all these little but VERY IMPORTANT pieces (like routes for the controller in the routes config file ... )?

Maybe I'm just not getting it, or seeing to many problems down the road. Maybe someone could provide a COMPLETE example (a very basic one, though) of how to set this up, to have a fully functioning RESTFul API – that is, the auto generated stuff?
Reply


Messages In This Thread
Need help understanding the docs on RESTFul? - by blaasvaer - 08-24-2020, 02:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB