mvinayakam

Member Since 5 Months Ago

Experience Points
1,080
Total
Experience

3,920 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
7
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

  • Community Pillar

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

Level 1
1,080 XP
May
09
5 days ago
May
05
1 week ago
Activity icon

Replied to RAW HTML Partially Stripped Off When Passed From Laravel To Vue

Data passed from Laravel to Vue . Checked with a dd in the blade.

<div><ul><li>List 1</li><li>List 2</li><li>List 3</li></ul></div>

Data received in vue. Checked via console.log & Vue Developer Tools Extension

List1</li>List 2</li>List 3</li> 

The data received in vue is used with a v-html but obviously it doesn't render as expected.

Activity icon

Replied to RAW HTML Partially Stripped Off When Passed From Laravel To Vue

Apologies for the incorrect formatting of code earlier. Have fixed it.

May
04
1 week ago
Activity icon

Started a new Conversation RAW HTML Partially Stripped Off When Passed From Laravel To Vue

Hello

I am adding Vue support to an existing Laravel system. Some of the datafields contain html tags.

Rendering it in Laravel was easy with the {!! option.

While passing it to vue, I am seeing that some of the tags are getting omitted out .

For e.g.

Data passed from laravel - I have verified this with a dd command in the blade.


<div><ul><li>List 1</li><li>List 2</li><li>List 3</li></ul></div>

gets passed to vue as

This is the data received in vue. I have verified it with a console.log and Vue developer tools.


List1</li>List 2</li>List 3</li> 

Any pointers on what I could be doing wrong would be great.

Apr
23
3 weeks ago
Activity icon

Replied to Duplicate Exception Handling - Model Create

Thanks a ton, It is a PDO Exception error. Got it to work now.

Activity icon

Started a new Conversation Duplicate Exception Handling - Model Create

Hello

I have promotion model which is a foreign key to promotionCodes.

I have a routine which generates a unique hashcode as a promotionCode for certain use cases. I want to handle the duplicate code situation.

    public function codes()
    {
        return $this->hasMany(PromotionCode::class);
    }

public function addCode($code,$validFrom,$validTo,$numberOfUses)
{
try{
            $this->codes()->create([
                "code"           => $code,
                "valid_from"     => $validFrom ?? now(),
                "valid_to"       => $validTo,
                "number_of_uses" => $numberOfUses
            ]);
}
catch (\Illuminate\Database\QueryException $e) {
		logger()->info("Duplicate code found");
        }
}

I have tried to trigger the exception by explicitly mentioning a duplicate code but the exception does not get triggered.

I am sure I am missing something very basic. Any pointers?

Feb
23
2 months ago
Activity icon

Replied to Retrieving Children And Grandchildren

This is super. Thank you

Activity icon

Replied to Where Are You All From?

Bengaluru, India

Activity icon

Started a new Conversation Retrieving Children And Grandchildren

I recently discovered the way to fetch children and grandchildren with this beautiful helper.

Context - This is a self referencing table.

Collection::get()->wherePosition('main-nav')
            ->whereLevel(1)
            ->orderBy('sequence')
            ->with('children.children.children');

How can i add conditions for the children / grandchildren?

Can anyone please provide me a link to the documentation for this?

Feb
22
2 months ago
Activity icon

Replied to Conditional Fetching Of Records

Hello

The above code helps solve the problem in couple of scenarios. In others I would need a different solution

$query-->whereLevel(1)
            ->orderBy('sequence')
            ->with('children.children.children');

The above mentioned collection model is a self referencing table with upto 2 sub levels. I retrieve the data using the above function.

How can I get the count of the associated products per child using this query?

Feb
21
2 months ago
Activity icon

Replied to Conditional Fetching Of Records

Thanks a ton.

I already have the products function defined. So the below should work?

 public function children()
    {
        return $this->hasMany(Collection::class, 'parent_id')->wherehas('products')->orderBy('sequence');
    }


    public function products()
    {
        return $this->belongsToMany(Product::class));
    }
Activity icon

Started a new Conversation Conditional Fetching Of Records

 public function children()
    {
        return $this->hasMany(Collection::class, 'parent_id')->orderBy('sequence');
    }


    public function products()
    {
        return $this->belongsToMany(Product::class));
    }

I have a Collection Model which could have children and be associated with products.

The children function above should return only those collections which have products associated with them.

How can i accomplish this?