rohan-krishna

rohan-krishna

Member Since 3 Years Ago

Chennai

Experience Points 15,960
Experience Level 4

4,040 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 156
Lessons
Completed
Best Reply Awards 0
Best Reply
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.

24 Mar
2 years ago

rohan-krishna started a new conversation Vuex How To Access State Data On Component Mounted Or Created Hook?

Hi,

I'm trying to create a Quill.js editor instance once component is loaded using mounted() hook. However, I need to set the Quill's content using Quill.setContents() on the same mounted() hook with the data I received from vuex.store.state .

My trouble here is that the component returns empty value for the state data whenever I try to access it, irrespective of being on mounted() or created() hooks. I have tried with getters and computed properties too. Nothing seems to work.

I have included my entry.js file, concatenated all the components to make things simpler for you to help me.

Vue.component('test', {
    template: 
    `
        <div>
            <ul>
                <li v-for="note in this.$store.state.notes">
                    {{ note.title }}
                </li>
            </ul>
            {{ localnote }}
            <div id="testDiv"></div>
        </div>
    `,
    props: ['localnote'],
    data() {
        return {
            localScopeNote: this.localnote,
        }
    },
    created() {
        this.$store.dispatch('fetchNotes')
    },
    mounted() {
        // Dispatch action from store
        var quill = new Quill('#testDiv', {
            theme: 'snow'
        });
        // quill.setContents(JSON.parse(this.localnote.body));

    },
    methods: {
        setLocalCurrentNote(note) {
            console.log(note.title)
            return this.note = note;
        }
    }
});

const store = new Vuex.Store({
    state: {
        message: "",
        notes: [],
        currentNote: {}
    },
    mutations: {
        setNotes(state,data) {
            state.notes = data;
            // state.currentNote = state.notes[1];
        },
        setCurrentNote(state,note) {
            state.currentNote = note;
        }
    },
    actions: {
        fetchNotes(context) {
            axios.get('http://localhost/centaur/public/api/notes?notebook_id=1')
                    .then( function(res) {
                        context.commit('setNotes', res.data);
                        context.commit('setCurrentNote', res.data[0]);
                    });
        }
    },
    getters: {
        getCurrentNote(state) {
            return state.currentNote;
        }
    }
});

const app = new Vue({
    store
}).$mount('#app');

And here is the index.html file where I'm rendering the component:

<div id="app">
    <h1>Test</h1>
    <test :localnote="$store.state.currentNote"></test>
</div>

Btw, I have tried the props option as last resort. However, it didn't help me in anyway. Sorry if this question is too long. Thank you for taking your time to read this. Have a nice day ;)

28 Oct
2 years ago

rohan-krishna left a reply on Event Not Broadcasting - 5.3

Hi there,

Even I was facing the same issue ... but it's mentioned in the documentation , you need to run queue listener for the event broadcasting to work.

https://laravel.com/docs/5.3/broadcasting#installing-laravel-echo

And hence when I ran this on command-line

php artisan queue:listen

It started to work. Hope this helps.

24 Oct
2 years ago

rohan-krishna left a reply on How To Send Mail Once Job Has Been Processed In The Queue

Any sample code for this? I'm a little inexperienced in this.

rohan-krishna started a new conversation How To Send Mail Once Job Has Been Processed In The Queue

Hi,

I have a situation where I need to upload huge data from csv file to database. I've managed to write a Job for processing the upload in the background using Queue. But I need to send a mail ( or even better, display a notification ) once the process has been completed. Please find below my Job for processing the upload ,

public function handle()
    {
        // Receive uploadedSheets from dispatcher
        // and process the uploads
        foreach($this->uploadedSheets as $sheetData)
        {   
            // 
             $tz = new Timezone();
             if(!empty($sheetData->timezone))
             {
                 $tz->name = $sheetData->timezone;
             }
             $tz->status = true;
             $tz->save();
         }
        Mail::to("[email protected]")->send(new TimezoneImported);
    }

The Mail method I've used here didn't work and I'm noob to Events too. Please explain if possible how to fire an event to display notification in the front-end or send a mail to user once upload is completed. Thank you.

19 Oct
2 years ago

rohan-krishna left a reply on VueJS How To Filter Multiple Values Using FilterBy

I tried to .... I got an infinite loop error ....

getAttendance: function(day,timezone) {
                            var month = moment().month(this.currentMonth).format('MM');
                            var fetchedDate = moment(this.currentYear + '-' + month + '-' + day,"YYYY-MM-DD");
                            var attendances = this.attendances;
                            this.timezones[0].forEach(function(attendance) {
                                return attendances.push(attendance);
                            });

                            return this.attendances;
                        }

rohan-krishna started a new conversation VueJS How To Filter Multiple Values Using FilterBy

I'm using Vue and Laravel and I need to filter and display timezone-based leave details for a month. I have done this with Angular but it was dead slow and my production servers couldn't display the data properly. I need help on how do I display the attendance data for each timezone with the queried date.

<div id="attTzTable">
                <input type="number" v-model="currentMonth">
                @{{ getDaysInMonth() }}

                <table class="table table-bordered">
                    <tr>
                        <td>Days</td>
                        <td v-for="day in getDaysInMonth()" class="success">@{{ day+1 }}</td>
                    </tr>
                    <tr>
                        <td class="info">Date/Timezone</td>
                        <td v-for="day in getDaysInMonth()" class="info">@{{ day+1  }}</td>
                    </tr>
                    <tr v-for="timezone in timezones[0]">
                        <th>@{{ timezone.name }}</th>
                        <td v-for="day in getDaysInMonth()">
                            <span>@{{ timezone.attendances | filterBy '2016-10-15' in 'attendance_date' }}</span>
                        </td>
                    </tr>
                </table>
            </div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.28/vue.js"></script>
            <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vue-resource/1.0.3/vue-resource.min.js"></script>

            <script>
                new Vue({
                    el: '#attTzTable',
                    data: {
                        timezones: [],
                        message: "Hello [email protected]",
                        currentMonth: moment().month(),
                        currentYear: moment().year()
                    },
                    created: function() {
                        return this.getTimezones();
                    },
                    computed: {

                    },
                    methods: {
                        getTimezones: function() {
                            var timezones = this.timezones;
                            return this.$http.get('../api/leaveplanner/timezones').then(function(res) {
                                return timezones.push(res.data);
                            }); 
                        },
                        getDaysInMonth: function() {
                            var month = this.currentMonth;
                            var daysInMonth = moment().month(month).daysInMonth();
                            return daysInMonth;
                        },
                        getAttendance: function(day,timezone) {
                            var month = moment().month(this.currentMonth).format('MM');
                            var fetchedDate = moment(this.currentYear + '-' + month + '-' + day,"YYYY-MM-DD");

                            return fetchedDate;
                        }
                    },
                    filters: {

                    }
                });
            </script>
01 Aug
2 years ago

rohan-krishna left a reply on How About Some Dart Tutorials?

Hey Godfather ... I was just requesting for some tutorials for something I wanna learn. And FYI, Laracasts has ton of other tutorials apart from Laravel. Get your facts straight.

rohan-krishna started a new conversation How About Some Dart Tutorials?

Hey @JeffereyWay ! How about some Dart tutorials? It seems to be very interesting and I cannot find good tutorials for it. It'll be of great help for beginners looking to learn the language.

28 Apr
3 years ago

rohan-krishna left a reply on Subtitles For Tutorials

@Prez Site's dead bro.

rohan-krishna started a new conversation Subtitles For Tutorials

This could really help non-native English speakers or some of us who'd like to listen to some music while working along with the tutorials.

16 Jan
3 years ago

rohan-krishna left a reply on Where Are You All From?

Chennai , India. Where grass is yellow-er and women aren't very hot!

15 Jan
3 years ago

rohan-krishna started a new conversation Hello World! Let's Say Hi Here!

I'm so glad I've finally found time to join Laracasts. Thank toy Jeffery very much for your tutorials. However , I think we should have a thread where our new members could say Hi to all. Here I am , Hello to our fellow developers! Thank you.