Uzenkov

Uzenkov

Minsk

Member Since 1 Year Ago

Experience Points 1,690
Experience
Level
Lessons Completed 9
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 Oct
1 month ago

Uzenkov left a reply on Get Data From API Before App Init

@D9705996, thank you for the answer! Could you please tell me, from what event may I work with Vuex? Will it be available on beforeCreate()?

Uzenkov started a new conversation Get Data From API Before App Init

Hello everyone! I need to get data from the API before my application is initialized. But what is "before app init"? Where is it? created() in App.vue, router.js, main.js or somewhere else? Thank you for any suggestions.

12 Oct
2 months ago

Uzenkov started a new conversation Webpack Config

Hello everyone! Do you know how to include styles/scripts in index.html file through Webpack? My situation: http://take.ms/hz9PC (but it doesn't work). I tried configuring my Webpack like that:

entry: {
  test: ['./src/test.js'],
  app: ['./src/main.js']
},

...but test.js file is loading as a second (and need that it loads first). Thank you for any suggestions!

29 Sep
2 months ago

Uzenkov left a reply on How To Make Moment Js Alive?

Thanks all for the answers!

Uzenkov left a reply on How To Make Moment Js Alive?

@tykus, I need the value to change after a certain interval. For example every minute. Moment js should work like that:

1 minute ago
2 minutes ago

Uzenkov left a reply on How To Make Moment Js Alive?

@tykus, just timestamp like '1538217923'.

Uzenkov left a reply on How To Make Moment Js Alive?

@Sergiu17, thank you for the answer! I already tried to do this, but it doesn't work (given empty result)...

Uzenkov started a new conversation How To Make Moment Js Alive?

Hello everyone! Here is my problem...

I have a filter:

filters: {
    last_activity(date) {
        return moment.unix(date).fromNow()
    }
}

It filters values in the table:

<td>{{ session.last_activity | last_activity }}</td>

It is possible to automatically update these values every 10 seconds?

03 Sep
3 months ago

Uzenkov left a reply on How To Get Copy Of The Vuex Store Object

@martinbean, sorry, it's a misspelling, I corrected it (result still empty).

Uzenkov started a new conversation How To Get Copy Of The Vuex Store Object

Good afternoon everyone! After three days of searching for a solution, I decided to ask here. I have stored variable user_profile.

  1. How to access it in mounted function? (console.log(this.user_profile) returns nothing)
  2. How do I make an unreactive copy of this variable to fill out the form with data?
computed: {

    ...mapGetters({
        user_profile: 'GET_USER_PROFILE',
    }),

    user_store_copy() {
        return this.user_profile // not working (data are reactive)
    }

},

mounted() {
    console.log(this.user_store) // not working
}
29 Nov
1 year ago

Uzenkov started a new conversation Laravel + CKEditor + CKFinder

Hello guys. Has anyone encountered the setting up of CKFinder in Laravel? The CKEditor works fine, and when I integrate the CKFinder into it, I get this error: screenshot

21 Nov
1 year ago

Uzenkov started a new conversation Database Structure

Hello everyone! If someone came across a similar problem, tell me, please, how to resolve it. There is a table of clients. There is a form through the client is created. In the form you can choose a person or a entity. They are distinguished by additional fields (there is a passport information in person and requisites in entity). In other words: they have the same fields and the different fields.

How do you usually implement such tasks? All fields in one table and use them as needed, or is there some more correct way (maybe several tables)?

My table structure

Schema::create('clients', function (Blueprint $table) {
  $table->increments('id');

  $table->unsignedInteger('company_id');
  $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');

  $table->unsignedInteger('user_id');
  $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');

  $table->enum('type', ['person', 'company'])->nullable()->default(null);
  $table->boolean('lead')->nullable()->default(null);
  $table->string('lastname')->nullable()->default(null);
  $table->string('name');
  $table->string('middlename')->nullable()->default(null);
  $table->string('phone_primary');
  $table->string('phone_secondary');
  $table->string('email')->nullable()->default(null);
  $table->string('social_url')->nullable()->default(null);
  $table->date('birthday')->nullable()->default(null);
  $table->enum('gender', ['male', 'female'])->nullable()->default(null);
  $table->json('tags')->nullable()->default(null);
  $table->text('description')->nullable()->default(null);
  $table->string('source')->nullable()->default(null);

  $table->string('pass_number')->nullable()->default(null);
  $table->string('pass_lastname')->nullable()->default(null);
  $table->string('pass_name')->nullable()->default(null);
  $table->string('pass_issue')->nullable()->default(null);
  $table->string('pass_issue_date')->nullable()->default(null);
  $table->date('pass_until_date')->nullable()->default(null);
  $table->date('pass_issue_until')->nullable()->default(null);

  $table->string('entity_position')->nullable()->default(null);
  $table->string('entity_name');
  $table->string('entity_unp')->nullable()->default(null);
  $table->string('entity_okpo')->nullable()->default(null);
  $table->string('entity_country')->nullable()->default(null);
  $table->string('entity_region')->nullable()->default(null);
  $table->string('entity_district')->nullable()->default(null);
  $table->string('entity_postcode')->nullable()->default(null);
  $table->string('entity_city')->nullable()->default(null);
  $table->string('entity_address')->nullable()->default(null);
  $table->string('entity_iban')->nullable()->default(null);
  $table->string('entity_bic')->nullable()->default(null);
  $table->string('entity_bank')->nullable()->default(null);

  $table->timestamps();
});
17 Nov
1 year ago

Uzenkov left a reply on Changing The Value In Real Time

@tykus Here is my components structure. As I understand it, the first levels is the parents :)

16 Nov
1 year ago

Uzenkov left a reply on Changing The Value In Real Time

@tykus I'm sorry for the trouble and newbie question. How do I know where my parent components are in my structure, and where are the children?

14 Nov
1 year ago

Uzenkov left a reply on Passing Data To Event

@tykus Thank you, it works!

Uzenkov left a reply on Changing The Value In Real Time

@tykus Thank you, it works for me! Now I'll try to understand the Vuex.

Uzenkov left a reply on Changing The Value In Real Time

@tykus Thank you for the answer! I'll try to describe in more detail.

Here is screencast how it looks now — reminders counter is not updated.

I use Laravel and Vue.js and my structure is:

Vue.component('show-reminders', require('./components/reminders/ShowReminders.vue'));
Vue.component('create-lead', require('./components/lead/CreateLead.vue'));

window.Event = new Vue();

const application = new Vue({
  el: '#application'
});

I tied to use events, but the problem still has not been solved.

I'll be glad to any help.

Uzenkov started a new conversation Passing Data To Event

Hello guys. I have a problem with $emit and $on events. Here is my code:

app.js

...
window.Event = new Vue();

const application = new Vue({
  el: '#application'
});

ShowReminders.vue

<template>
  <el-badge :value="reminders.count" class="item">
    <span uk-icon="icon: bell"></span>
  </el-badge>
</template>

<script>

  export default {

    data() {
      return {
        reminders: {
          count: window.reminders.length
        }
      }
    },

    created() {
      Event.$on('lead-created', function(val) {
        this.reminders.count += val // returns undefined, there is a problem
      })
    }

  }

</script>

CreateLead.vue

<template>
...
<el-button type="success" @click="addLead" round>Add Lead</el-button>
</template>

<script>
  export default {

    ...

    addLead() {
        let counter = window.reminders.length + 1
        Event.$emit('lead-created', counter)
      ...
    }

    ...

  }
</script>

The question is: why I can't pass variables from data to Event.$on function?

Uzenkov left a reply on Changing The Value In Real Time

@tykus But i have 2 different components, how can I pass the processed variable from CreateLead.vue to ShowReminders.vue?

Uzenkov started a new conversation Changing The Value In Real Time

Hello everybody! Can someone tell me the correct solution of the problem? I need (the counter)[http://take.ms/uEGjZ] to be changed when an element is added.

I have the following...

ShowReminders.vue

<template>
  <el-badge :value="reminders.count" class="item">
    <span uk-icon="icon: bell"></span>
  </el-badge>
</template>

<script>

  export default {

    data() {
      return {
        reminders: {
          count: window.reminders.length
        }
      }
    }

  }

</script>

CreateLead.vue

<template>
...
<el-button type="success" @click="addLead" round>Add Lead</el-button>
</template>

<script>
  export default {

    ...

    getData() {
      window.reminders.length++ // it doesn't work
      ...
    }

    ...

  }
</script>
08 Nov
1 year ago
07 Nov
1 year ago

Uzenkov left a reply on CORS Problem

@CJJ It's a 3rd party public Viber API. When i use Chrome CORS Extension it works fine, but without extension 'Access-Control-Allow' headers are not sent...

Uzenkov left a reply on CORS Problem

@CJJ Unfortunately, this does not work for me. The error still appears.

Uzenkov started a new conversation CORS Problem

Hi everyone. I have this problem when i'm trying to send Viber message through VueJS. Could you tell me please how can I fix this?

01 Nov
1 year ago

Uzenkov started a new conversation Page Loading

Hello guys! Who knows how to make a real page preloader without using vue-router? My solution of the problem is using v-cloak like this:

[v-cloak] > * { display:none; }
[v-cloak]::before { content: "Loading..."; }

But I don't like this solution. I like something like vue-top-progress, but don't know how implement it in my project.

My temporary incorrect solution is:

mounted() {
  this.$refs.topProgress.start();
  setTimeout(() => {
    this.$refs.topProgress.done()
  }, 500)
}

Thank you for any help!

28 Oct
1 year ago

Uzenkov left a reply on Avoid Mutating A Prop Directly Since The Value Will Be Overwritten Whenever The Parent Component Re-renders

Problem solved.

I replaced it...

items: [{
  name: '',
  brand: '',
  status: ''
}],

...with this one.

items: [],

Thank you guys for the answers.

Uzenkov left a reply on Avoid Mutating A Prop Directly Since The Value Will Be Overwritten Whenever The Parent Component Re-renders

@goatshark Thank you for the answer. It makes sense, but even if I pass the property directly to the template, the error does not disappear.

<el-select v-model="this.itemstatus" @change="setStatus"  placeholder="Check status">
  <el-option label="Sale" value="sale"></el-option>
  <el-option label="Ordered" value="ordered"></el-option>
  <el-option label="Paid" value="paid"></el-option>
</el-select>
27 Oct
1 year ago

Uzenkov left a reply on Avoid Mutating A Prop Directly Since The Value Will Be Overwritten Whenever The Parent Component Re-renders

I solved the problem, moving everything into one component. But if someone answers my question, I will be grateful.

Uzenkov started a new conversation Avoid Mutating A Prop Directly Since The Value Will Be Overwritten Whenever The Parent Component Re-renders

Hello guys. Tell me, please, what I'am doing wrong.

Items.vue

<el-table :data="items" border style="width: 100%"> <el-table-column prop="name" label="Name"> </el-table-column> <el-table-column prop="brand" label="Brand"> </el-table-column> <el-table-column prop="status" label="Status" sortable> <status-select :itemid="scope.row.id" :itemstatus="scope.row.status"> </status-select> </el-table-column> </el-table>

import Table from 'element-ui/lib/table'; import TableColumn from 'element-ui/lib/table-column';

export default {

components: { 'el-table': Table, 'el-table-column': TableColumn },

data() {
  return {
    items: [{
      name: '',
      brand: '',
      status: ''
    }]
  }
},

methods: {

  getItems() {
    axios.get('/api/items')
    .then(response => {
      this.items = response.data.items;
    })
    .catch(error => {
      console.log(error.response.data);
    });
  }

},

mounted() {
  this.getItems();
}

}

StatusSelect.vue

<el-select v-model="status" @change="setStatus" placeholder="Check status"> <el-option label="Sale" value="sale"></el-option> <el-option label="Ordered" value="ordered"></el-option> <el-option label="Paid" value="paid"></el-option> </el-select>

import Select from 'element-ui/lib/select'; import Option from 'element-ui/lib/option';

export default {

props: ['itemid', 'itemstatus'],

components: { 'el-select': Select, 'el-option': Option },

data() { return {

}

},

computed: { status: { get() { return this.itemstatus }, set(value) { this.itemstatus = value; } } },

methods: {

setStatus() {
  axios.patch('/api/items/'+this.itemid+'/status', { 'status': this.itemstatus })
  .then(response => {
    swal({
      buttons: false,
      text: response.data.message,
      icon: 'success',
      timer: 1000
    });
  })
  .catch(error => {
    console.log(error.response.data);
  });
}

},

created() { this.status = this.itemstatus; }

}

I get this error: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "itemstatus".