Member Since 2 Weeks Ago

Experience Points

4,690 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
Best Reply Awards
Best Reply
  • 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.


    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.


    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 1
310 XP
1 week ago
Activity icon

Started a new Conversation Should I Use Pipelines For Searching, Filtering, Sorting And Paginate


I'm creating an inventory system in Laravel 7. I want to create a way to search, filter, limit, and paginate the products in my index.blade.php view. Very similar to what e-commerce pages have... Where you can filter by categories, active or inactive products, and search by the product's name or product id.

I already have the pagination by using Laravel's paginate function, but I still need to get the dynamic limit...


I know there are several ways to accomplish this... Like creating pipelines, create methods in a Repository file and etc... Is there a Laravel way of doing this?

1 week ago
Activity icon

Started a new Conversation Is Having A Polymorphic Table For Storing My Image Information More Efficient Than A Separate Table For Each Model

Background Information:

In Laravel 7, I have many Models like Product, Variant, User, Container, and Package that can have an Image.


Should I create a polymorphic table called images to store the images for all of the models?

Or is it more efficient to have separate tables to store the images of that specific model?

  • For example product_images, variant_images, user_images and etc...


  • The Product has approximately 600 records.

  • The Variant has approximately 200 records.

  • The User has approximately 10 records.

  • The Container has approximately 300 records.

  • The Package has approximately 200 records.

Activity icon

Replied to How To Model My Data Efficiently

@bugsysha I'm sorry I'm lost. I don't know which table you want to get rid off or if you want to get rid of the variants table and just create a new product for each variation.

2 weeks ago
Activity icon

Replied to How To Model My Data Efficiently

Yeah, barcode references the variant, but I'm still not sure I understand why do you need to keep serial numbers in your database. Also you will not have one product/variant scattered in different locations in your warehouse? Repair should be based on serial number which has a reference to a product/variant and from there you track repairs.

@bugsysha Ahhh I see what you are trying to do... you want to replace the barcodes for serial numbers. I can give you a couple of reasons why this won't work.

  • I already have my data collected and there are two different stock (item) that have the same serial number.
  • I have a QR Code reader that acts like a keyboard and not all stocks (items) have the ability to scan the serial number because they might be 10 years old. The ones who have the ability might also be in a place where the scanner can't reach.
  • I have times where not all the stocks of the product have a serial number. This is for many reasons... the sticker might be washed away or broken or fell off. So if I have a total of 30 stocks, 10 of those stocks might have this problem.
  • I already made the investment of purchasing a total of 3,500 QR Codes and attached them to each stock.

Here is an image of an example. I still haven't added the attributes for Serial Number, Location, Last Repair and etc... but the should be on a column for each attribute between barcode and condition. https://drive.google.com/file/d/1LD9VL64BNuNeV0UFIAjG0CufKUuhedrS/view?usp=sharing

Activity icon

Replied to How To Model My Data Efficiently

@bugsysha I'm going to give you an example of why the stocks table is necessary and it can't be replaced by a column on the variants or products table. In my inventory, there is a Product called "L-Acoustics K2 Modular WST Line Source". I have a total of 60 of that product. All 60 of that product have different attributes specific to that item like Serial Numbers, location in the warehouse, if it has been repaired before, the condition it is, when it was bought and etc... Another product in my inventory is "Microphone cable" this product comes in many lengths (i.e. 25 feet, 50 feet, 100 feet and etc...). Therefore, it has many variants. In this case, not all cables have a specific barcode attach to it. This is why there's a column called quantity in the stocks table. In this case, the barcode will reference the variant. So when I'm preparing an order I can scan the variant's barcode and specify a quantity the order requires.

What would be your solution to modeling the data for this scenario?

Activity icon

Replied to How To Model My Data Efficiently

@bugsysha I care about the barcodes because each item in the inventory (i.e. speakers, cables, consoles, etc...) has a unique barcode. When performing inspections you can scan the item and log that you performed the inspection in that item (stock) and when creating an order, you can assign to the order a product with a quantity of 20. When you go to prepare the order, you scan each item and you know that that item went to that specific order... In other words, the barcode is like an SKU...

Activity icon

Replied to How To Model My Data Efficiently

@bugsysha Yes! I feel like this would be the case for when the product have different lengths or color or sizes; like cables... but when the product is something like a speaker, then it kind of becomes a group of stocks.

Activity icon

Replied to How To Model My Data Efficiently

@bugsysha No, because the stocks table holds the barcodes. For example: If the company has 60 speakers, there will be 60 records in the stocks table with a unique barcode pointing to that product or speaker.

Activity icon

Started a new Conversation How To Model My Data Efficiently

Project Specifications:

I'm building an inventory system focused on sound companies in Laravel 7. So far I have 3 models: Product, Variant, and Stock.

  • The product model is for creating the product itself.
  • The variant model is because the same product, lets say a cable can have many lengths.
  • The stock model is where the barcodes of each product are stored and you know the quantity of each product you have.

A product can take two paths:

product --> [hasMany] stocks


product --> [hasMany] variants --> [hasMany] stocks

As you can see, both paths end up having stocks.

The problem:

I want to be able to show the available quantity that each product has. If the product has variants, I want to be able to show the available quantity per variant.

What is the most efficient way to model this data? Should I use polymorphic relationships on the Stock Model? Should I create two stocks table (1 table for the Variant and 1 table for the Product)? Or should I use a hasManyThrough relationship with Variant and Stock?

What I've tried:

I created a polymorphic relationship for the Stock model. So that both Product and Variant models can have Stock. But I don't think this is the most efficient way.

Here is my database design https://drawsql.app/wsp/diagrams/wsp/embed

2 weeks ago
Activity icon

Started a new Conversation How To Display A Breadcrumb From Root The Category To The Product's Category


On my product's detail page I want to display a breadcrumb of all the parent categories that my product has.

For example, if there is a product that is assigned a category_id pointing to a SubSubCategory; I want the breadcrumb to be:

Root Category / SubCategory / SubSubCategory


Some products might a category_id that points to the root category (has no children) and other products might have a category_id that points to a category that is 2 levels deep (has two parents). How do I handle these scenarios?

What I have tried:

This is my https://i.stack.imgur.com/anCRh.png

This is my https://i.stack.imgur.com/g1iHS.png

So far, if I wanted to get the category breadcrumb of a specific product I would do it like this:

{{$product->category->parent->name}} / {{$product->category->name}}

But it quickly had errors with the products that had a root category assigned to them. Because I was trying to get a relationship that didn't exist.

2 weeks ago
Activity icon

Started a new Conversation How To Build A Database Schema For An Inventory System With Product Stock, Variation And Attributes?

Background Information:

I'm trying to learn how to build an inventory tracking system for a sound company. I'm new to this and have no experience but I'm a fast learner, so please go easy on me. Before I start building the application, I want to make sure that I have the correct relational database design.

Design Requirements:

Each product has a stock that can be tracked individually (each stock has its own barcode) or bulk (stock has one barcode). Bulk tracking is mostly for cables because it's hard to put a barcode for each cable and scan each cable when it goes to an event.

Where I'm stuck on:

The product may have different variations. For example: "Cable Lenght", "Container Size", "Color", "Microphone Gain" and etc... The company can have the same cable in different lengths. Or have the same container in different sizes. Instead of creating a product for each length, I want to create a product variation.

In addition, each product may have different attributes. For example: "Frequency Band", "Serial Number", "Container Dimensions", "Firmware Version" and etc... A wireless microphone has attributes like Frequency Band, Firmware Version, and Serial Number. While there are products like containers that only have dimensions.

I already have a database design but I'm sure it is not correct and there can be a lot of improvements


  • Not every product has a variation.
  • So far, if the product has a variation is only one type that applies to that product.
  • Not every product has all of the attributes. Some may only have Serial Number and some may have none.
  • The main reason for creating a variation, instead of an attribute, is because I want to track the quantity of each product variation.


Database design I have in mind https://drawsql.app/wsp/diagrams/wsp/embed

Populated products table https://i.stack.imgur.com/XlUOk.jpg

Populated stocks table https://i.stack.imgur.com/qtz9V.jpg