mironmg

mironmg

Member Since 4 Years Ago

Experience Points
23,950
Total
Experience

1,050 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
187
Lessons
Completed
Best Reply Awards
7
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.

Level 5
23,950 XP
Mar
11
4 months ago
Activity icon

Replied to Adding Data In Pivot Table With Array Structure In Form

@abdulbazith I think it would be easier for you if you just create a basic blog project first just to get used to the database relationships. Look into the "belongsToMany" relationship in laravel documentation and try understand how that works. Your form is wrong. You need to have topic linked to chapter AND the chapter to a subject so once you add chapter_id in your form you don't really need the subject_id because you have access to it through the chapter already. You associate the class with the topic with a pivot table and that is being done backend after you created the topic.

Mar
07
4 months ago
Activity icon

Replied to Mapping Class And Subject And Chapters Into Many To Many Relationship Laravel

@abdulbazith with that table you create a link between class and topic. then the topic is associated with other entities and you can query those via the topic. eg class->topic => displays the topic class->topic->chapter displays the chapter and so on.

Mar
04
4 months ago
Activity icon

Replied to Mapping Class And Subject And Chapters Into Many To Many Relationship Laravel

@abdulbazith You need to decide first if 1 chapter belongs to more subjects.

I would say tables should be like

classes ( id, name ) //slug or others if you want
subjects (id, name ) // slug or others if you want
chapters(id, name, subject_id)	// this belongs to a subject so it's a "child"
topics (id, name, chapter_id) // topic is child of chapter
class_topic (id, class_id, topic_id) // this is the pivot table because each class studies a topic...

So then you have class < - > topic relationship

and topic -> chapter -> subject relationships...

In your example it's like the following

$class_5 = ClassObject::find(5);
$topics = $class_5->topics()->get();

// iterate and display topic->name

Activity icon

Replied to How Can I Assign Data From A Prop To A Form Object?

I don't think he can do that because is form is getting populated with error objects from server validation so that would mess-up things.

Activity icon

Replied to Displaying Posts From Different Categories(I Am Getting Error) (@foreach($posts As $post))

@henryoladj I think we all understand but you need to check your code and actually understand it before asking us to write the code for you You said it yourself. You have categories in the sidebar..and each category has posts. so you're going at it the wrong way

public function index(Request $request)
    {
        $categories = Category::all() ; // or just the categories you need
        return view('pages.welcome',compact('categories'));
    }

and in blade file you have

@foreach($categories as $category)
	<h3>{{$category->name}}'s posts</h3>
	@foreach($category->posts()->take(5)->get() as $post)
		{{$post->title}}
	@endforeach	
@endforeach

Of course this is far from ideal if you scale because there are too many loops and you should read the documentation on eagerloading . But I hope it helps you understand the basic logic and what's it doing

Activity icon

Replied to How Can I Assign Data From A Prop To A Form Object?

<template>
    <div>
        <h1 v-text="title"></h1>
        <title-form
            ref="TitleForm"
            :title="title"
            @update="update"
        ></title-form>
    </div>
</template>
<script>
    import TitleForm from "../../components/bind/TitleForm";
    export default {
        components: {
            TitleForm
        },

        data() {
            return {
                id: 15,
                title: ''
            }
        },

        async beforeMount() {
            await this.getData();
        },

        methods: {
            async getData() {
                await axios.get('/pages/', {
                    params: {
                        id: this.id
                    }
                })
                    .then( response => this.applyData( response.data ))
                    .catch( errors => console.log( errors ))
            },

            applyData( data ) {
                this.title = data.title;
            },

            update( title ) {
                this.title = title;
            }
        }
    }
</script>