app/Http/Controllers/Api/TransactionController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request, $customerId)
    {
        $transactions = [];
        if($customerId){
            $transactions = Transaction::getTransactionByCustomerId($customerId);
        };
        return response()->json($transactions);
    }
public function index ( Request $ request , $ customerId ) { $ transactions = [ ] ; if ( $ customerId ) { $ transactions = Transaction :: getTransactionByCustomerId ( $ customerId ) ; } ; return response ( ) -> json ( $ transactions ) ; }
Display a listing of the resource.
Display a listing of the resource .