mansoorkhan8

Member Since 10 Months Ago

Experience Points
2,860
Total
Experience

2,140 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
22
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
2,860 XP
Mar
19
1 month ago
Activity icon

Started a new Conversation Stripe Rate Limit Option In Laravel Spark

Hello, I am looking for an option in Laravel Spark where i can specify Stripe Rate Limit https://stripe.com/docs/rate-limits

I cannot see this in config files.

Activity icon

Replied to Alpine Js Does Not Sync Data For X-text And X-model, If Used In A Loop On Table Row

Oh, My bad. It's a typo, I am returning an object in my project. Let me just update this everywhere.

Activity icon

Replied to Alpine Js Does Not Sync Data For X-text And X-model, If Used In A Loop On Table Row

I tried to move the <tbody> inside the the <template> and it works but It breaks the table so it does not works as expected :( Here is what i tried:

<template x-for="employee in employees">
    <tbody>
        <tr>
            <td>
                <input x-model="employee.basic_salary">
            </td>
            <td x-text="employee.basic_salary"></td>
        </tr>
    </tbody>
</template>

<script>
function data() {
    return {
		employees: [
        	{id:1, basic_salary: 6000},
        	{id:2, basic_salary: 7000},
    	]
	}
}
</script>

One should never put a loop before <tbody>

Mar
18
1 month ago
Activity icon

Replied to Alpine Js Does Not Sync Data For X-text And X-model, If Used In A Loop On Table Row

employees is an array of objects.

<script>
function data() {
    return {
		employees: [
        	{id:1, basic_salary: 6000},
        	{id:2, basic_salary: 7000},
    	]
	}
}
</script>
Activity icon

Started a new Conversation Alpine Js Does Not Sync Data For X-text And X-model, If Used In A Loop On Table Row

I am trying to loop over employees array and I want show employee salary and an input field to edit employee salary. The problem is that Alpine does not sync data from input field to the text element. Example:

<tbody>
<template x-for="employee in employees">
    <tr>
        <td>
            <input x-model="employee.basic_salary">
        </td>
        <td x-text="employee.basic_salary"></td>
    </tr>
</template>
</tbody>

<script>
function data() {
    return {
		employees: [
        	{id:1, basic_salary: 6000},
        	{id:2, basic_salary: 7000},
    	]
	}
}
</script>
Feb
25
2 months ago
Activity icon

Replied to Media Manager

I know this question is 1 year old but I would like to add my answer to help other people.

You can use this amazing package, It has a lot of features to offer.

https://github.com/ctf0/Laravel-Media-Manager

They also have a demo to check if you get errors.

https://github.com/ctf0/demos/tree/media-manager

Feb
23
2 months ago
Activity icon

Awarded Best Reply on Eloquent Condition Inside Nested With()

I use this amazing package, https://github.com/topclaudy/compoships And this is the solution I have come up with.

// App\Models\Level
public function studentsExaminationResult()
{
    return $this->hasMany(Student::class, 'level_id');
}

// App\Models\Student;
use \Awobaz\Compoships\Compoships; // Package Trait to be able to use multi foreign key relations
public function examination()
{
    return $this->hasMany(
        Examination::class,
        ['student_id', 'level_id'],
        ['id', 'level_id']
    )
    ->orderBy('subject_id');
}

// App\Http\Controllers\ExaminationController;
$examinationResult = Level::with([
    'subjects',
    'studentsExaminationResult' => fn ($query) => $query->with([
    'examination' => fn ($inner_query) => $inner_query->where('year', $year)
           ->where('term', $term),
    ]),
])->get();
Activity icon

Replied to Eloquent Condition Inside Nested With()

I use this amazing package, https://github.com/topclaudy/compoships And this is the solution I have come up with.

// App\Models\Level
public function studentsExaminationResult()
{
    return $this->hasMany(Student::class, 'level_id');
}

// App\Models\Student;
use \Awobaz\Compoships\Compoships; // Package Trait to be able to use multi foreign key relations
public function examination()
{
    return $this->hasMany(
        Examination::class,
        ['student_id', 'level_id'],
        ['id', 'level_id']
    )
    ->orderBy('subject_id');
}

// App\Http\Controllers\ExaminationController;
$examinationResult = Level::with([
    'subjects',
    'studentsExaminationResult' => fn ($query) => $query->with([
    'examination' => fn ($inner_query) => $inner_query->where('year', $year)
           ->where('term', $term),
    ]),
])->get();
Feb
22
2 months ago
Activity icon

Replied to Eloquent Condition Inside Nested With()

I have checked this last night. It works for me.

Feb
21
2 months ago
Activity icon

Started a new Conversation Eloquent Condition Inside Nested With()

Hi, I need some help! On line number 3, I want to pass student.level_id (dynamic value from within the query results) in where('level_id', ??) dynamically. Any idea How should I do it?

In other words, I want to convert this SQL query to Eloquent:

SELECT * FROM levels
JOIN students on (levels.id = students.level_id)
JOIN examinations on (examinations.level_id = students.level_id AND examination.student_id = students.id)

This is the code I have tried so far.

$levels = Level::with(['students' => function ($query) {
            $query->with(['examination' => function ($inner_query) use ($query) {
                $inner_query->where('level_id', '???');
            }]);
        }])->get();