maidul98

maidul98

Member Since 3 Months Ago

Experience Points 270
Experience Level 1

4,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 0
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.

18 Mar
2 months ago

maidul98 started a new conversation Get A Select Number Of Results From A With()

with(array('comments.replies' => function($query) { $query->get()->take(1);}))

I want to get the 3 most recent comments within this with a statement. How do I do that?

12 Mar
2 months ago

maidul98 started a new conversation How To Combain Two Tables In One Result Algolia

I have a posts table set up with algolia and everything works fine. Now I want to add a custom attribute to each post, which I have done, that shows if a post has been bookmarked by the current user. Since Aloglia isn't a relational database how can I show posts and have a custom attribute added if the post has been bookmarked?

28 Feb
2 months ago

maidul98 left a reply on Get Each Bookmark With Post

@HOSEINZ3 - The primary key is ID. Want_id is the foreign key on my bookmarks table.

23 Feb
2 months ago

maidul98 started a new conversation Get Each Bookmark With Post

I want post type called Want and I have a Bookmarks table. I want to get each post type of Want with a bookmark if the logged in user has bookmarked that post.

Relationship on the Want Model.: public function bookmark(){ return $this->belongsTo('App\Bookmark', 'want_id'); }

Here is my query:

Want::where(['status'=> 1])->with('user')->with(array('bookmark' => function($query) { $query->where('user_id', Auth::user()->id); }))->orderBy('created_at', 'desc')->paginate(10);

My problem is I get null for a bookmark with each Want even though some Wants should have been bookmarked.

Any thoughts?

21 Feb
2 months ago

maidul98 started a new conversation Get The Total Count Of Unread Messages

I have conversations table that takes in two users who are called fulfiller and the other wanter. Each convo has many messages belong to a user_id. Each message has user_id, convo_id and it has a seen field which is 0 or 1 indicating if messages has been read by the other user. How can I get the total number of unread messages from all convos the current user belongs in?

14 Feb
3 months ago

maidul98 left a reply on How Do I Get The Count Of A Relationship With Some Constraints?

No, it's not a foreign key, it's just a row to keep track of seen / unseen. Should it be foreign?

maidul98 started a new conversation How Do I Get The Count Of A Relationship With Some Constraints?

I want to get the count of unread messages along with each convo. Here is what I have.

My relationship is as such: public function unseen(){ return $this->hasMany('App\Message', 'seen'); }

Everything in bellow works, just not the withCount part. I want to get total unread messages from everyone who is not the current user in this convo. In the messages table, i have seen to 0 by default and when seen it becomes 1.

Conversation::where(function ($query) { $query->where('fulfiller_id', '=', Auth::user()->id)->orWhere('wanter_id', '=', Auth::user()->id); })->with('want', 'fulfiller', 'wanter')->orderBy('updated_at', 'desc')->withCount( ['unseen' => function ($query) { $query->where('seen', '!=', 1); }])->get();

When i do this, I just get zero for all of the convos, which is not true. What am i missing?