vendredi 2 octobre 2020

WebSocket connection to 'protocol=7&client=js&version=4.3.1&flash=false' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

I was implementing laravel websockets package in project it is working fine in my local machine but on server first it was giving error of Connection timeout That problem was solved when add TCP port in aws security group but after that it starts giving new error

WebSocket connection to 'ws://52.64.101.38:6001/app/ABCDEF?protocol=7&client=js&version=4.3.1&flash=false' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

Here are errors I am getting in console when try to connect websocket server enter image description here

I was searching about this error i found this github thread . Which is saying try to bound with 0.0.0.0 but I dont know what does it means,

https://github.com/GeniusesOfSymfony/WebSocketBundle/issues/251

I was also getting this error on local machine but was later resolved when i downgrade package version 1.6

NOTE: I am using ubuntu server aws services



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/33lc4nu
via IFTTT

Laravel validating indexed arrays

I have a form which has a like name[0].

I'm struggling to find a way to validate the arrays. The 'name.*' => 'required', validation rule doesn't work. It gives a htmlspecialchars() expects parameter 1 to be string, array given

Any ideas on what I can do?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Sjizkj
via IFTTT

websocket connection closed before established laravel on ubuntu server?

I have implemented websocket in laravel framework. It is working fine on localhost windows OS but giving error on live ubuntu server

["Connecting",{"transport":"ws","url":"ws://IP-Address:6001/app/qwerty?protocol=7&client=js&version=7.0.0&flash=false"}]

I think this is error because port is not allowing to connect. but i am not sure about it. What should i do? I am using aws webservices

Added rule enter image description here



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30IpBE3
via IFTTT

laravel vuejs validation array of pushed inputs

i need to validate array of pushed inputs by vue.js the problem i can't get validation error message for every input, i can't displaying errors resulting from Laravel Array validation in vue js. Anyone any pointers? i get error "Cannot read property '0.upstreamlevel' of undefined"
Thanks in advance! enter image description here enter image description here laravel controller '''

$rules = [
            '*.upstreamlevel' => 'required',
            '*.downstreamlevel' => 'required',
        ];

        $Messages = [
            '*.upstreamlevel.required' => '  please enter upstream',
            '*.downstreamlevel.required' => 'please enter downs',
        ];
        $this->validate($request, $rules, $Messages);

'''

vuejs template

'''

<template>
  <div v-for="(aRecord, index) in listOfRecords">
                               
<input type="text" v-model="aRecord.upstreamlevel" id="upstreamlevel"
 name="upstreamlevel[]" class="form-control">
<div v-for="(error,  index) in errors">
<strong></strong>

 <input type="text" v-model="aRecord.downstreamlevel" id="downstreamlevel"
   name="downstreamlevel[]" class="form-control">
<div v-for="(error,  index) in errors">
<strong></strong>
</div>
</template>
<script>
    export default {
        data() {
            return {
                listOfRecords: {},
                month: null,
                year: null,
                daysList:0,
                structures: [],
                errors : {},
            }
        },
    methods: {},
        AddNew: function () {
                axios.post(`/new`, this.listOfRecords)
        }
        getDays: function (event) {
                // `this` inside methods points to the Vue instance
                this.daysList = new Date(this.year, this.month, 0).getDate();
                this.listOfRecords=[];
                for (let i = 1; i < this.daysList; i++) {
                    this.listOfRecords.push(
                        {
                            daytime: i+'/'+this.month+'/'+this.year,
                            upstreamlevel: '',
                            downstreamlevel: '',
                        }
                    );
                }
            }
 }
</script>

'''



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30rrxR2
via IFTTT

Poplating invoice items with cart data - Laravel - Invalid argument supplied for foreach()

Trying to display the list of Items in the cart after the Order is successfull. Unable to populate the Cart Items(cart_items) while generating the Invoice.

Cart Data before being saved to database,

dd($request['cart_items']);
        $cart =  Cart::updateOrCreate([
            'user_id' => $user_id,
            'cart_items' =>  $request['cart_items'],
        ]);

[{"productName":"demo product","productPrice":"1600","productId":"1","productImage":"http://localhost/EcommerceBackend/public//assets/images/product/thumb/books.jpg","productQuantity":2},{"productName":"demo product","productPrice":"1600","productId":"1","productImage":"http://localhost/EcommerceBackend/public//assets/images/product/thumb/books.jpg","productQuantity":2}]

In my Invoice Blade

{
   "id":1,
   "orderId":"ORDER--1",
   "orderAmount":"2400.00",
   "created_at":"2020-09-23T02:29:44.000000Z",
   "updated_at":"2020-09-23T02:29:44.000000Z",
   "ecommerce_prepayment_orders":{
      "id":1,
      "user_id":1208268476,
      "cart_id":2,
      "order_name":"ORDER--1",
      "billing_name":"asdasdfa",
      "billing_last_name":"asdfasdfasdf",
      "address":"asdfasdf",
      "pancard":"",
      "gstin":"",
      "deleted_at":null,
      "created_at":"2020-09-23T02:29:16.000000Z",
      "updated_at":"2020-09-23T02:29:16.000000Z",
      "cart":{
         "id":2,
         "user_id":1208268476,
         "cart_items":"[{\"productName\":\"Product Name\",\"productPrice\":\"1200\",\"productId\":\"1\",\"productImage\":\"http:\/\/localhost\/EcommerceBackend\/public\/\/assets\/images\/product\/thumb\/Product Name.jpeg\",\"productQuantity\":2},{\"productName\":\"Product Name\",\"productPrice\":\"1200\",\"productId\":\"1\",\"productImage\":\"http:\/\/localhost\/EcommerceBackend\/public\/\/assets\/images\/product\/thumb\/Product Name.jpeg\",\"productQuantity\":2}]",
         "deleted_at":null,
         "created_at":"2020-09-23T02:29:16.000000Z",
         "updated_at":"2020-09-23T02:29:16.000000Z"
      }
   }
}

I was able to populate the other data except the cart_items.

When I try to loop the foreach, it returns Invalid argument supplied for foreach()

  @foreach ($invoice_items['ecommercePrepaymentOrders']['cart']->cart_items as $item)
    
    @endforeach

What I am doing wrong.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3jmoBMU
via IFTTT

jeudi 1 octobre 2020

login form in all pages of laravel [closed]

is it possible to have a login form on all laravel pages? i'm aiming to put it into the header I'll only need the email and submit field. It'll be like an easy login on header, if so can please explain to me how to possibly do that?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30noUiX
via IFTTT

How can I easily identify lazy loaded property in Laravel

I am developing a large web application in Laravel-5.8. It contains many lazy loaded property. Now, I want to easily identify which property is lazy loaded and stop them.

I tried to use https://github.com/derkinderfietsen/laravel-disable-lazyload package but it only shows error if it finds any lazy loaded property. But I wat to identify the property too. Can anyone suggest me a good way?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2HM7Lcp
via IFTTT