Hammadrashid

Member Since 1 Year Ago

Experience Points
720
Total
Experience

4,280 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
1
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
720 XP
May
08
1 day ago
Activity icon

Replied to Edit Product With Multiple Images Problem

I can also sync images but the problem is that when I submit the form the product_images[] array goes empty. Because none of the file inputs are set with previously stored images!

Activity icon

Started a new Conversation Edit Product With Multiple Images Problem

I'm facing problem in retrieving all product images when i try edit product. So the scenario is that I've separate product_images table where I store multiple images of a product. Now for instance a product already have 3 images and user wants to add 4th image, or in other case, if a user wants to delete 3rd image only. In both of these scenarios I have to sync all images. How can I achieve this on edit page? because i think input type file values can not be set like input type text values.

May
02
1 week ago
Activity icon

Replied to Interview Question: Fetch 1 Million Records

I told him the same. But he said no he wants non technical answer :/

Activity icon

Started a new Conversation Interview Question: Fetch 1 Million Records

So in my last interview the interviewer asked me a scenario based question which I couldn't answer. I thought why not discuss it here with you people.

Question: Suppose if we have to fetch 1 million records in to MySql database through PHP API. What is best way to fetch with minimal memory usage and in minimum amount of time?

Apr
30
1 week ago
Activity icon

Replied to Shared Hosting Cache Issue

I'm using bluehost hosting. Do you have any idea how to disable it?

Activity icon

Started a new Conversation Shared Hosting Cache Issue

My laravel project is hosted on shared hosting and am facing server cache issue. Like if i ever use dd() or dump() in controller, the next time i hit that function I get the same result even if i remove that whole function. Unless i use "?nocache=2" at the end of the url. How can i get rid of it?

Apr
29
1 week ago
Activity icon

Replied to Where Are You All From?

Karachi, Pakistan

Activity icon

Started a new Conversation Access Laravel Auth In Vue Component

Is there any possible way to access current authenticated user in vue js ? I'm using simple laravel auth. I tried to access in controller also but it didn't work.

Apr
19
2 weeks ago
Activity icon

Started a new Conversation Is It The Best Approach?

I'm printing the cateogires on sidebar but I feel like it is not the best approach to achieve this. I'm getting the perfect results. Let me know if someone would recommend the best practice. Controller

    public function productSubListing(Request $request)
    {

        try{
            $active = null;
            $subActive = null;
            $product = new Product();
            $brands = new Brand();
            if($request->has('catid'))
            {
                $category = Category::all();
                $product = $product->where('category_id',$request->catid)->get();
                $active = $request->catid;
            }
            
            if($request->has('subcatid'))
            {
                $category = Category::all();
                $product = $product->where('sub_cat_id',$request->subcatid)->get(); 
                
                $sub = SubCategory::find($request->subcatid);
                $subActive = $sub->id;
                $active = $sub->category->id;
            }

            if($request->has('brand_id')){
                
                $category = Category::all();
                $product = $product->where('brand_id',$request->brand_id)->first()->get();   
            }
      
            if($request->has('category'))
            {
                $category = new SubCategory();
                $category = $category->first()->get();
                $product = $product->where('category_id',$request->category)->first()->get();
            }
            elseif($request->has('subcategory'))
            {   $category = new SubCategory();
                $category = $category->first()->get();
                $product = $product->where('sub_cat_id',$request->subcategory)->first()->get();
            }
            $brands = Brand::all();
            return view('product.productListing', compact('category','product','brands','active','subActive'));
        }
        catch(Exception $ex)
        {
            return back();
        }
       
    }

View

@forelse($category as $cat)
     @if(count($cat->product) || count($cat->subCategory->product))
         <form method="GET" action="{{ route('selectCat') }}" id="myForm" name="theForm">
             <input type="hidden" value="{{$cat->id}}" name="catid"/>
              <input type="submit" value="{{ $cat->name }}" class="custom-control-label" ><span class="float-right">({{ count($cat->product) }})</span>
            </form>
      @if(count($cat->subCategory )  && $cat->id == $active)
           <ul>   
             @foreach($cat->subCategory as $subcategory)
                  <li class="{{ $subcategory->id == $subActive ? 'is-active':'is-not-active'}}">
                     <form method="GET" action="{{ route('selectCat') }}" id="myForm" name="theForm">
                         <input type="hidden" value="{{$subcategory->id}}" name="subcatid"/>
                             <input type="submit" value="{{$subcategory->name}}" class="custom-control-label {{ $subcategory->id == $subActive ? 'is-active':'is-not-active'}}" ><span class="float-right">({{ count($subcategory->product) }})</span>
                     </form>
                 </li>
                 @endforeach
              </ul>
                  @endif
         @endif
  @empty
    <p>No Results</p>
@endforelse
Apr
15
3 weeks ago
Activity icon

Replied to Concatenate String On Blade

Yes it is printing industry names but without pipe. I meant only implode function is not working

Activity icon

Replied to Concatenate String On Blade

@neilstee same result.

// Automotive Industry |
// Automotive Bearings | Industrial Bearings
Activity icon

Replied to Concatenate String On Blade

@tykus Actually implode function is totally not working here. I don't know why

Activity icon

Replied to Concatenate String On Blade

Yes @tykus I exactly copy pasted your both suggestions one by one and still it doesn't work.

Activity icon

Replied to Concatenate String On Blade

@tykus

This is the result

Automotive Industry
Automotive Bearings Industrial Bearings
Activity icon

Replied to Concatenate String On Blade

@tykus

Yes, I tried both ways but it is not printing "|" anymore

Activity icon

Replied to Concatenate String On Blade

Nope @neilstee still same

Activity icon

Replied to Concatenate String On Blade

I tried both ways but it is not printing "|" anymore

Activity icon

Replied to Concatenate String On Blade

Didn't work.

Activity icon

Replied to Concatenate String On Blade

@sergiu17

It works fine when items > 1 but if there is single item it still prints "|"

// Automotive Industry |
// Automotive Bearings | Industrial Bearings
Activity icon

Started a new Conversation Concatenate String On Blade

I want to concatenate "| " after every industry name except the last one. How can I achieve this in simple way?

  @foreach($ind as $record1)
          @foreach($indus as $industry)
                 @if($industry->id == $record1)
                        {{ $industry->name }} 
                  @endif
              @endforeach
        @endforeach
Apr
14
3 weeks ago
Activity icon

Started a new Conversation What's Your Opinion About Laravel Certification ? Is It Worthy?

Does it really play a part in getting job as a laravel developer?

Activity icon

Started a new Conversation Confused On Collections

I'm getting the same response below when find category by id

   $category = App\Category::find(12)->first(); 
// or this
	$collection = collect((object) $category);
{
"id": 12,
"name": "Bearings",
"description": "A bearing is a machine element that constrains relative motion to only the desired motion, and reduces friction between moving parts.",
"image": "http://category/images/1616856647.png",
"industry_id": "9",
"created_at": "2021-03-27T14:50:47.000000Z",
"updated_at": "2021-03-27T14:50:47.000000Z"
}

But when I'm trying to dump and die $collection->name it says Property [name] does not exist on this collection instance.

while $category->name works fine. Can someone explain me what's happening?