WebbieWorks

WebbieWorks

Member Since 3 Years Ago

Experience Points
1,250
Total
Experience

3,750 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 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 1
1,250 XP
Jun
03
1 day ago
Activity icon

Replied to Product Page Not Displaying

Appreciate the reply, Any help on how I can make it to where the urls would be

domain /used-equipment/category-name
domain /used-equipment/product-name
Activity icon

Started a new Conversation Product Page Not Displaying

When clicking on the product from the category page (page that lists products in category), The page is just refreshing and not going to the product page.

web.php

Route::get('/used-equipment/{category}', '[email protected]')->name('usedequipment.list'); 
Route::get('/used-equipment/{product}', '[email protected]')->name('usedequipment.show');  

UsedController

public function list()
    {

        $products = Product::with('categories')->whereHas('categories', function ($query) {
            $query->where('slug', request()->category);
        })->get();
        $categories = Category::with('children')->where('parent_id',2)->get();      
        

        return view('/used-equipment/category')->with ([
            'products' => $products,
            'categories' => $categories, 
          ]);
    }

    /**
     * Display the specified resource.
     *
     * @param  string  $slug
     * @return \Illuminate\Http\Response
     */
    public function show($slug)
    {
        $product = Product::where('slug', $slug)->firstOrFail();

        
        return view('/used-equipment/product')->with('product', $product);
    }

Link that should go to product page

<h3 class="product-title"><a href="{{ route('usedequipment.show', $product->slug) }}">{{ $product->name }}</a></h3>

I have been beating my head against the desk all morning about this. I do not see where I messed up. Any help would be greatly appreciated.

Also, I wanted to add, when I go directly to the page instead of /used-equipment/ the product page works.

example

Route::get('/{product}', '[email protected]')->name('usedequipment.show');
May
24
1 week ago
Activity icon

Replied to Trying To Get Property 'name' Of Non-object

That code gives me a blank page.

What I have works on the category page.

Example...

domain .com/Category-Name (works and lists all products in that category)

When I click on a product, it should go to domain .com/Category-Name/Product-name (the product.blade)

That is the page I am getting the non-object error

May
23
1 week ago
Activity icon

Replied to Trying To Get Property 'name' Of Non-object

I appreciate it. Any insight on what to ad to get this to work?

Activity icon

Started a new Conversation Trying To Get Property 'name' Of Non-object

I'm a bit confused by this one. I have search all around and havent found anything that fixes this.

The reason this is confusing is because it works when calling the category page, but does not work when calling the product page.

line that shows error in UsedController

 $categoryName = $categories->where('slug', request()->category)->first()->name;

UsedController

public function list()
    {

        $products = Product::with('categories')->whereHas('categories', function ($query) {
            $query->where('slug', request()->category);
        })->get();
        $categories = Category::with('children')->where('parent_id',2)->get();      
        $categoryName = $categories->where('slug', request()->category)->first()->name;
        $categoryDesc = $categories->where('slug', request()->category)->first()->description;

        return view('used-equipment/category')->with ([
            'products' => $products,
            'categories' => $categories, 
            'categoryName' => $categoryName,
            'categoryDesc' => $categoryDesc,
          ]);
    }
    
     /**
     * @param  string  $slug
     * @return \Illuminate\Http\Response
     */
    public function show($slug)
    {
        $products = Product::where('slug', $slug)->firstOrFail();
        $mightAlsoLike = Product::where('slug', '!=', $slug)->inRandomOrder()->take(4)->get();

        
        return view('/used-equipment/product')->with([
            'products' => $products,
            'mightAlsoLike' => $mightAlsoLike,
        ]);
    }

product.blade.php

@foreach ($products as $product)
    <div class="row mb3">
        <aside class="col-sm-5 border-right">
            <article class="gallery-wrap"> 
                <div class="img-big-wrap">
                  <div> <a href="#"><img src="https://www.valiantindustriesllc.com/wp-content/uploads/Adco-Cartoner9-400x337.jpg"></a></div>
                </div> <!-- slider-product.// -->
                <div class="img-small-wrap">
                  <div class="item-gallery"> <img src="https://www.valiantindustriesllc.com/wp-content/uploads/CanningLine-4-400x400.jpg"> </div>
                  <div class="item-gallery"> <img src="https://www.valiantindustriesllc.com/wp-content/uploads/CanningLine-4-400x400.jpg"> </div>
                  <div class="item-gallery"> <img src="https://www.valiantindustriesllc.com/wp-content/uploads/CanningLine-4-400x400.jpg"> </div>
                  <div class="item-gallery"> <img src="https://www.valiantindustriesllc.com/wp-content/uploads/CanningLine-4-400x400.jpg"> </div>
                </div> <!-- slider-nav.// -->
            </article> <!-- gallery-wrap .end// -->
        </aside>

        <aside class="col-sm-7">
        <article class="card-body">

            <h1 class="productTitle valRed">{{ $product->name }}</h1>
            <p class="breadcrumbs breads mb-3"><a href="/">Home</a> / <a href="/used-equipment">Used Equipment</a> / <a href="/">Complete Packaging Lines</a></p>
        <hr>
        <dl class="item-property">

          <dd><p>{{ $product->short_description }}</p></dd>
        </dl>
        

            <hr>
            <form action="{{ route('quote.store') }}" method="POST">
            {{ csrf_field() }}
            <input type="hidden" name="id" value="{{ $product->id }}">
            <input type="hidden" name="name" value="{{ $product->name }}">
            <button type="submit" class="btn btn-lg btn-danger text-uppercase">Request Quote</button>
            </form> 
            

        </article> <!-- card-body.// -->
        </aside> <!-- col.// -->
    </div> <!-- row.// -->
    <div class="row section-lg">
       <div class="col-sm-12">
            <h3 class="productTitle valRed">Additional Information</h3>
        </div>    
        <div class="col-sm-12">
        <dd><p>
            {{ $product->long_description }}
          
            </p></dd>
        </div>
    </div>
    @endforeach

web.php

Route::get('/used-equipment', '[email protected]')->name('usedequipment.index');
Route::get('/used-equipment/{category}', '[email protected]')->name('usedequipment.list');
Route::get('/used-equipment/{product}', '[email protected]')->name('usedequipment.show');

But it works fine on the category page.

<div class="prodlistDiv">
                    <div class="row mb-40">
                        <h1 class="valRed">Used {{ $categoryName }} for Sale</h1>
                        <p>{{ $categoryDesc }}</p>
                    </div>
                    
                    @foreach ($products as $product)
                    <div class="row">
                        <div class="col-lg-1" style="padding-left:0">
                            <a href="{{ route('usedequipment.show', $product->slug) }}"><img src="https://www.valiantindustriesllc.com/wp-content/uploads/Whole-line-view-400x400.jpg" width="100px"></a>
                        </div>
                        
                        <div class="col-lg-9" style="padding-left:50px">

                            <h2 class="productTitle valRed"><a href="{{ route('usedequipment.show', $product->slug) }}">{{ $product->name }}</a></h2>
                            <p class="justify paragraph16">{{ $product->short_description }}</p>
                        </div>
                        <div class="col-lg-2" style="padding-left:20px">
                            <div class="snipcart-details top_brand_home_details item_add single-item hvr-outline-out button2">
                                    <a href="{{ route('usedequipment.show', $product->slug) }}">View Details</a>
                                </div>
                        </div>
                        <hr height="10px" width="90%" color="#ffffff" style="border-top: 3px solid rgba(0,0,0,.1);">
                    </div>
                    @endforeach
May
14
3 weeks ago
Activity icon

Started a new Conversation Products / Categorie Pivot Tables

I hope I explain this right.

I have 2 main categories (new / used), then I have child categories under those & products assigned to each child category. What I am trying to do is create a pivot table so that I can display products based on the child category they belong to.

The tables I have are

Products (with category_id)
Categories (with id)
Category_Product (with category_id & product_id)

What would be the best way to link the product_id & category_id together in the pivot table (category_product) ? I am new to laravel databases and following a tutorial, but they did a seeder which I do not want to do since I have all the products and categories already.

Any help would be greatly appreciated.

May
12
3 weeks ago
Activity icon

Replied to Show Products Based On Category Id

Getting same outcome, All products show.

Activity icon

Started a new Conversation Show Products Based On Category Id

I am pulling my hair out. I am trying to show products based on category ID's. but it is showing all products.

In my database, I have a categories table (id =1-60), then I have my products table that has category_id which is the id of the category the product belongs to.

Controller

public function categories()
    {
        if (request()->categories) {
            
            $products = Product::with('category_id')->whereHas('category_id', function ($query) {
                $query->where('slug', request()->category_id);
            
            })->get();

            $categories = Category::with('children')->where('parent_id',2)->get();
        
        } else {
            
            $products = Product::all();
            $categories = Category::with('children')->where('parent_id',2)->get();
        }
        return view('used-equipment/category')->with([
            'products' => $products,
            'categories' => $categories,

        ]);

    }

web.php

Route::get('/used-equipment/{category}.php', '[email protected]')->name('usedequipment.categories');

I cannot for the life of me figure out how to show the product based on the category ID.

Mar
02
3 months ago
Activity icon

Replied to After Uploading To Server, Uploaded Image Dont Show

SOLVED: Had to edit the filesystems.php code. Changed

'voyager' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),// change here something specific to your application need
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
        ],

to

'voyager' => [
        'driver' => 'local',
        'root' => storage_path('/storage'),// change here something specific to your application need
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
        ],
Activity icon

Started a new Conversation After Uploading To Server, Uploaded Image Dont Show

I do not understand why it is so complicated to get uploaded images to the right path.

I am using Laravel 6.5.2 and Voyager. I clicked on the "fix symlink" and it did not help.

What I have tried that has not fixed the issue:

created and ran php file with

<?php
symlink('/home/sendmailer/ValiantVoyager/public/storage', '/home/sendmailer/public_html/storage');

Changed in config/filesystem.php

'public' => [ 'driver' => 'local', 'root' => public_path('app/public'), 'url' => env('APP_URL').'/storage', 'visibility' => 'public', ],

I do not know why this is not working right.

Dec
15
5 months ago
Activity icon

Replied to PostTooLargeException Error

Yes, I edited the file located /etc/php.ini

Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)
Activity icon

Started a new Conversation PostTooLargeException Error

I am trying to upload a file and I am getting the above error. I have changed my php.ini file and restarted the local server. Laravel Framework 5.8.17

post_max_size = 2048M
upload_max_filesize = 2000M

When I run php -i. I see the changes are there.

post_max_size => 2048M => 2048M
upload_max_filesize => 2000M => 2000M

I am completely confused on why I cannot upload a 25mb attachment. Any help would be greatly appreciated.

Dec
05
5 months ago
Activity icon

Started a new Conversation Which Route Is Better?

Hey all, I am learning Laravel and I have seen the routes coded in 2 different ways and was wondering which one is better (easier) for an ecommerce site?

Route::get('/used-equipment.php', '[email protected]')->name('usedequipment.index');

or

Route::get('/used-equipment.php', [
    'uses' => '[email protected]',
    'as' => 'categories.usedequipment',
]);