php - Laravel Route Params and Form Params -


i have backend in laravel, rest api, because i'm using angularjs in fronend , making ajax requests.

let's have make crud users

and don't know if there difference between putting of parameters in route or of them in form input.

for example:

route::post('/users/update', 'userscontroller@update); 

and call 'id' parameter from:

input::get('id') 

or

route::post('/users/update/:id', 'userscontroller@update); 

and include parameter of function update like:

public function update($id) { } 

is there real difference between 2 ways? maybe security issues? coding standards? or same?

should use laravel's rest controllers?

if building rest api should have url example.com/posts/42 , not example.com/posts?id=42 because cleaner , coding standard.

i drop uppercase characters in urls , go second choice of implementation. way, if need update user should use put request so: put users/:id.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -