ubaid

Member Since 4 Years Ago

Experience Points
1,270
Total
Experience

3,730 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
2
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,270 XP
Jan
22
4 days ago
Activity icon

Started a new Conversation Livewire: Component Do Not Update

I have 3 components

  1. Sibling
  2. Parent
  3. Child

In the Parent component I am listening to an event triggerPar which is emitted by the Sibling and an ID is passed. The Parent passes that ID to the Child. But the view does not update upon clicking the button Update the view. If I add something extra to the parent.html after the view is rendered and before the next click; and then click Update the view the view is updated.

How can I manually trigger the update view in such cases?

<!-- sibling.html -->

<div>
<button wire:click="$emit('triggerPar', 'xx019990')">
   Update the view
</button>
</div>

<!-- parent.html -->
<div>
<livewire:child :pId="$pid" />
</div>

// Parent.php

public $pid;

public $listeners = [
   'triggerPar' => 'setAndUpdate'
];

public function setAndUpdate($pid) {
   $this->pid = $pid;
}

<!-- child.html -->

<div>

{{ $pid }}

</div>

// Child.php

public  $pid = null;

public function mount($pId) {
   $this->pid = $pid;
}

Jan
14
1 week ago
Activity icon

Awarded Best Reply on Livewire Model Is Not Working On Larvel Component Radio

Updated Livewire and the issue is fixed.

Activity icon

Replied to Livewire Model Is Not Working On Larvel Component Radio

Updated Livewire and the issue is fixed.

Activity icon

Replied to Livewire Model Is Not Working On Larvel Component Radio

No effect, and the HTML from browser inspect for my implementation shows the attributes are mapped correctly


<label class="inline-flex items-center">
    <input type="radio" class="rounded-full border-gray-300 text-primary shadow-sm focus:border-primary-extra-light focus:ring focus:ring-primary-extra-light focus:ring-opacity-50" id="r1" name="test" value="one" wire:model="test.radio">
    <span class="ml-2 text-sm text-gray-600">One</span>
</label>

<label class="inline-flex items-center">
    <input type="radio" class="rounded-full border-gray-300 text-primary shadow-sm focus:border-primary-extra-light focus:ring focus:ring-primary-extra-light focus:ring-opacity-50" id="r2" name="test" value="two" wire:model="test.radio">
    <span class="ml-2 text-sm text-gray-600">Two</span>
</label>

Jan
13
1 week ago
Activity icon

Started a new Conversation Livewire Model Is Not Working On Larvel Component Radio

I have created a Laravel component for radio (not livewire component)

<!-- ui-radio -->
<label class="inline-flex items-center">
    <input type="radio" {{ $attributes->merge(['class' => 'rounded-full border-gray-300 text-primary shadow-sm focus:border-primary-extra-light focus:ring focus:ring-primary-extra-light focus:ring-opacity-50']) }}>
    <span class="ml-2 text-sm text-gray-600">{{ $slot }}</span>
</label>

When I use the component with livewire it doesn't work

<x-ui-radio name="test" value="one" wire:model="test.radio">
One
</x-ui-radio>

<x-ui-radio name="test" value="two" wire:model="test.radio">
Two
</x-ui-radio>

public $test = [
    'radio' => 'one'
];

But if I use the wire:model on HTML for radio it works normally. What am I missing here

Oct
07
3 months ago
Activity icon

Started a new Conversation @props: Variable Value Is Always Equal To Initialized Value Inside Laravel Blade Component

Hi,

I am having trouble with @props. Inside the component I have something like:

@props(['testclass' => ''])
@php
    $c = 'bg-transparent hover:bg-blue-500';
    // $c .= ' ' . $testclass;
@endphp

the $testclass is always empty but when I dd($attributes) after removing @props the attribute is there.

 Illuminate\View\ComponentAttributeBag Object ( [attributes:protected] => Array ( [testclass] => 'xkadfasd' ) ) 1 

Can someone explain what I might be doing wrong?

Sep
09
4 months ago
Activity icon

Awarded Best Reply on Blade Component Reusability Issue, Getting Error: Cannot Declare Class

Okay! So I found the issue, the Namespace was wrong. I forgot to change it to App\View\Components\Card\Body

Activity icon

Replied to Blade Component Reusability Issue, Getting Error: Cannot Declare Class

Okay! So I found the issue, the Namespace was wrong. I forgot to change it to App\View\Components\Card\Body

Activity icon

Started a new Conversation Blade Component Reusability Issue, Getting Error: Cannot Declare Class

Hello,

I have created blade component for bootstrap card and when I try to use it twice I get the error:

 Cannot declare class App\View\Components\Body, because the name is already in use 

My component structure inside the View\Components Folder

Card
|--- Body
|--- Card
|--- Footer
|--- Header

Each respective view has the following code (only change is the class):

<div {{ $attributes->merge(['class' => 'card-body']) }}>
    {{ $slot }}
</div>

Now when I use it in other view-x.blade.php as follows I get the error mentioned above,

<div class="row pt-4">
            <div class="col-sm-4">
                <x-card.card>
                    <x-card.body>
                        The content will come here...
                    </x-card.body>
                </x-card.card>
            </div>

            <div class="col-sm-8">
                <x-card.card>
                    <x-card.body>
			the content will come here...
                    </x-card.body>
                </x-card.card>
            </div>
        </div>

Any clue on what I am doing wrong? Why am I not getting the same error for other components like the <x-card.card>?