Angular passing params to Laravel to edit

I am using laravel 5.1, how can the request accept an id passing by angular via an api call? Here is my code.

    .factory('Account', function($http){
        return {
getProductToEdit: function(pid){
                //console.log(pid) ----> return 16
                return $http.get('/api/productedit',pid);

My backed function:

public function updateProductAPI(Request $request)
         $prodId = $request->all(); ---> return []
         // $request->input('pid'); ---> Object {}

         return response()->json($prodId);


Source: laravel

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.