helpmyworld

helpmyworld

Member Since 1 Year Ago

Experience Points 3,670
Experience
Level
Lessons Completed 0
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

23 May
6 months ago

helpmyworld left a reply on Unable To Run Composer Install And Update On Production

Thank you, this was easy i am embarrassed. I enabled the function in my WHM Cpanel.

helpmyworld left a reply on This Page Isn’t Working Www.maimoonahgori.co.za Is Currently Unable To Handle This Request. HTTP ERROR 500

This is my own server, i am using WHM Cpanel, created a reseller account inside this server.

helpmyworld left a reply on This Page Isn’t Working Www.maimoonahgori.co.za Is Currently Unable To Handle This Request. HTTP ERROR 500

It happens for every url. the entire website is showing that error.

Cronix please enlighten me, when i check the logs, what do i look for? I am asking because i am learning as i build.

helpmyworld started a new conversation Unable To Run Composer Install And Update On Production

i am using putty to log on to my server. i navigate to my laravel project to run "composer update or install" i get the below error

  The "https://packagist.org/packages.json" file could not be downloaded: all
  ow_url_fopen must be enabled in php.ini (https:// wrapper is disabled in th
  e server configuration by allow_url_fopen=0
  failed to open stream: no suitable wrapper could be found)

Please assist

helpmyworld started a new conversation This Page Isn’t Working Www.maimoonahgori.co.za Is Currently Unable To Handle This Request. HTTP ERROR 500

I know that this this issue has been tackled before but all the answers out there do not solve my problem.

My website was working well not it is showing this error. Please assist.

05 Apr
8 months ago

helpmyworld left a reply on NotFoundHttpException In RouteCollection.php (line 179) I Am Unable To View Books In A Specified Category.

i managed to get it to work with this the following:

Route::get('/books/cats/book/{id}', '[email protected]');

 public function getbook($id){

        $book=Product::find($id);

        return view('front.book',compact('book'));
    }

Thank you

04 Apr
8 months ago

helpmyworld started a new conversation NotFoundHttpException In RouteCollection.php (line 179) I Am Unable To View Books In A Specified Category.

I am unable to view books in a specified category.

how can I make a route for this "http://localhost:8000/books/cats/book/2"?

I do not have a route, I do not know how to make one that yields the desired end results.

My Scenario is this: I have a book and I need to categorize them, so far I am able to put them in different categories however I am unable to view books in a specified category.

The current routes and controller:

Route::get('/books/cats/{cat}','[email protected]');



 public function index(Category $category)
    {

       $postsPerPage = 10; //As many posts as you want to show on each page
       $posts = $category->posts()->orderBy('id', 'desc')->paginate($postsPerPage);
        //$posts = Post::->paginate(3);
       return view('front.blog', compact('posts'));
    }

Somone please educate me.

14 Mar
8 months ago

helpmyworld left a reply on Wordpress Themes On Laravel 5.4 CMS

@oooALIooo, may i see your finished project (cms). Share your link with me please.

03 Feb
10 months ago

helpmyworld started a new conversation (1/1) TokenMismatchException In VerifyCsrfToken.php (line 68)

Good day

I am trying to send an email via contact form. I get the error to say " (1/1) TokenMismatchException"

I tried to run php artisan config: cache and php artisan cache: clear

Rechecked my .env file and mail.php to see if it is the same as my email smtp details but nothing seem to work.

27 Jan
10 months ago

helpmyworld left a reply on Pictures Do Not Display On Production Server Failed To Load Resource: The Server Responded With A Status Of 500 (Internal Server Error)

@m-rk allow me to say i also do not like including public to get my css right. this is the link to my website http://sgmpublishing.co.za/

Please assist me. I not sure of your question but when i visit my page i see the address link of my website as i provided up there. Can you perhaps guide me? I would really appreciate it.

26 Jan
10 months ago

helpmyworld left a reply on Pictures Do Not Display On Production Server Failed To Load Resource: The Server Responded With A Status Of 500 (Internal Server Error)

@m-rk i got it right. I just learned that i had to reference the full path.

It was like this ``` @if(!empty($author->image)) @endif

now i made it like this

@if(!empty($author->image)) @endif```

I just added "/public/" and it worked.

helpmyworld started a new conversation Pictures Do Not Display On Production Server

Good day

I have deployed my laravel app successfully, however, pictures do not display/show on the production site.

May I please be assisted.

25 Jan
10 months ago

helpmyworld left a reply on Display Youtube Thumbnail On Laravel Blog (alaouy/Youtube)

thank you bobby, i will learn as much as i can to get the desired end results

22 Jan
10 months ago

helpmyworld left a reply on Youtube API V3 PHP Objects Structure

@masandikdev

Can you share with me how you achieve the desired results from the beginning? I want to show youtube videos on my blog. I want to show just a thumbnail and allow users to proceed to watch videos on youtube.

helpmyworld left a reply on Linking To Youtube

shiva can you help me achieve the same results?

helpmyworld started a new conversation Display Youtube Thumbnail On Laravel Blog (alaouy/Youtube)

Good day, has anyone used the "alaouy/Youtube" plugin successfully. I would like some assistance, please.

I'd like to show youtube thumbnail on my laravel blog. Is there any available video tutorial that can help me learn.

Although github has some instructions(alaouy/Youtube) they are challenging for me because I am not familiar with programming. I do what I see in the videos.

16 Jan
10 months ago

helpmyworld left a reply on Create Or Save Products With Category

I am embarrassed to say i am copying youtube videos and trying to make up my own things as i go along.

So an honest answer is I do not know what i am doing because i am just learning as i watch. I thought perhaps if i copy how i make categories that way i do with blog post it was going to yield the same results.

helpmyworld started a new conversation Create Or Save Products With Category

Good day. May I please be assisted. I would like to save products with the category. I have a Product Model and Controller and same with Cats. So far I am able to create categories and they are stored in my db. I am also able to create products but when I select a category it does not display the category.

Here is my model and controller

{
    protected $fillable=['name','description','title','image','price'];

    public function cats()
    {
        //
        return $this->belongsToMany('App\Cat');
    }
    
}



    public function create()
    {

        $cats = Cat::all();
        return view('admin.product.create',compact('cats'));
    }

    
    public function store(Request $request)
    {

        $this->validate($request,[
           'name'=>'required',
           'description'=>'required',
           'price'=>'required',
           'image'=>'image|mimes:png,jpg,jpeg|max:10000'
        ]);

        $product = new Product();

        $product ->name = $request->input('name');
        $product ->title = $request->input('title');
        $product ->description = $request->input('description');
        $product ->price = $request->input('price');
        $product ->image=$request->input('image');

        if($request->hasFile('image')) {
            $file = Input::file('image');
            //getting timestamp
            $timestamp = str_replace([' ', ':'], '-', Carbon::now()->toDateTimeString());

            $name = $timestamp. '-' .$file->getClientOriginalName();

            $product->image = $name;

            $file->move(public_path().'/images/', $name);
        }
        
        $product ->save();
        $product->cats()->sync($request->cats, false);
        Session::flash('flash_message', 'Service successfully added!');
        return redirect()->back()->with('success', 'Service Successfully Added');
      
    }

I'd really like to have my products with categories

11 Nov
1 year ago

helpmyworld left a reply on Display More Than One Tag On Views

I found a solution, it turns out I did not put "[]" in my code.

                                        @foreach($tags as $tag)
                                            <option value="{{$tag->id}}">{{$tag->name}}</option>
                                        @endforeach
                                    </select>
10 Nov
1 year ago

helpmyworld left a reply on Display More Than One Tag On Views

@robrogers3 if you may, where do i do the dd($post->tags in the controller? Not trying to be funny or anything but i am learning as i work.

helpmyworld left a reply on Display More Than One Tag On Views

@wilk_randall your method works, however, still getting the same results on my views.

@Dry7 I am carefully checking my code and css.

Thank you.

helpmyworld left a reply on Display More Than One Tag On Views

@robrogers my dd($post->tags) show that I have 3 tags or 2 tags in a case where I did select more than one tag.

helpmyworld started a new conversation Display More Than One Tag On Views

Good day, how do I display all selected tags to show in my posts views. When I dd, I see that I have more than one tag but on the view, it shows only one, the first tag.

my view

 <dl class="dl-horizontal">
                            <dt>Tags:</dt>
                            <dd>
                                @foreach($post->tags as $tag)
                                    <span class="label label-default"><a href="{{route('tags.show',
                                  $tag->id)}}" style="color:white;">{{$tag->name}}</a></span>
                                @endforeach
                            </dd>
                        </dl>

My post model and tag models are ok.

What else should I show you to help?

15 Oct
1 year ago

helpmyworld left a reply on RouteCollection.php Line 179:

i just use the following Route::get('/photos/create/{id}','[email protected]')

but shouldn't my Route::resource('photos','PhotosController'); be able to cover the above function?

helpmyworld started a new conversation RouteCollection.php Line 179:

Good day

The video that i am learning from to create a Photo gallery says that i must create like the the code below. i want to check if this is the right way to create. i am actually uploading a photo inside my album. i am getting arror to say "RouteCollection.php line 179:" when i follow the method below.

Controller

public function create($album_id){
        return view('admin.photos.create')->with('album_id', $album_id);
    }

 public function store(Request $request)
    {

        // validation
        $this->validate($request,[
            'title'=>'required',
            'photo'=>'image|mimes:png,jpg,jpeg|max:10000'
        ]);

        $request->hasFile('photo');
        $image = $request->file('photo');
        $filename = time() . '.' . $image->getClientOriginalExtension();
        $location = public_path('images/' . $filename);

        Image::make($image)->resize(800, 400)->save($location);

        $image->image = $filename;

        $photo = new Photo();
        $photo->album_id = $request->input('album_id');
        $photo->title = $request->input('title');
        $photo ->description = $request->input('description');
        $photo ->size = $request->file('photo')->getClientSize();
        $photo->photo = $filename;

        $photo ->save();


        return redirect('/album/' .$request->input('album_id'))->with('success', 'Album Created');


    }

helpmyworld started a new conversation Trying To Get Property Of Non-object

where did i go wrong?

Controller


 public function show($id)
    {
        //
        $album = Album::with('photos')->find('$id');
        return view('admin.album.show')->with('album',$album);
    }


MY VIEW\\

<div class="col-md-6 ">

                        <h2>{{$album->name}}</h2>
                        <a class="button secondary" href="/">Go Back</a>
                        <a class="button " href="/photos/create/{{$album->id}}">Upload Photos To Album</a>
                        

                    </div>


helpmyworld started a new conversation Display Images From Database

Good day

Can i please be enlightened, i must display images that i stored in my database when i create an album.

Controller

 public function store(Request $request)
    {

        // validation
        $this->validate($request,[
            'name'=>'required',
            'cover_image'=>'image|mimes:png,jpg,jpeg|max:10000'
        ]);


        $request->hasFile('cover_image');
        $image = $request->file('cover_image');
        $filename = time() . '.' . $image->getClientOriginalExtension();
        $location = public_path('images/' . $filename);

        Image::make($image)->resize(800, 400)->save($location);

        $image->image = $filename;

//
       $album = new Album();
       $album->name = $request->input('name');
       $album ->description = $request->input('description');
       $album->cover_image = $filename;
//
       $album ->save();
//        dd($album);


//       Session::flash('flash_message', 'Service successfully added!');

        return redirect()->route('album.index');


    }```

View

```

May i please be assisted.

09 Sep
1 year ago

helpmyworld left a reply on ErrorException In CartController.php Line 73: Trying To Get Property Of Non-object

@kirankrishnan

in CartController.php line 73 at HandleExceptions->handleError(8, 'Trying to get property of non-object', 'C:\xampp\htdocs\hmw\app\Http\Controllers\CartController.php', 73, array('id' => '1', 'product' => null, 'ebook' => object(Ebook))) in CartController.php line 73 at CartController->addItem('1') at call_user_func_array(array(object(CartController), 'addItem'), array('id' => '1')) in Controller.php line 55 at Controller->callAction('addItem', array('id' => '1')) in ControllerDispatcher.php line 44 at ControllerDispatcher->dispatch(object(Route), object(CartController), 'addItem') in Route.php line 203 at Route->runController() in Route.php line 160 at Route->run() in Router.php line 559 at Router->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing{closure}(object(Request)) in SubstituteBindings.php line 41 at SubstituteBindings->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in VerifyCsrfToken.php line 65 at VerifyCsrfToken->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ShareErrorsFromSession.php line 49 at ShareErrorsFromSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in StartSession.php line 64 at StartSession->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in EncryptCookies.php line 59 at EncryptCookies->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Router.php line 561 at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 520 at Router->dispatchToRoute(object(Request)) in Router.php line 498 at Router->dispatch(object(Request)) in Kernel.php line 174 at Kernel->Illuminate\Foundation\Http{closure}(object(Request)) in Pipeline.php line 30 at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in TransformsRequest.php line 30 at TransformsRequest->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in ValidatePostSize.php line 27 at ValidatePostSize->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in CheckForMaintenanceMode.php line 46 at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 148 at Pipeline->Illuminate\Pipeline{closure}(object(Request)) in Pipeline.php line 53 at Pipeline->Illuminate\Routing{closure}(object(Request)) in Pipeline.php line 102 at Pipeline->then(object(Closure)) in Kernel.php line 149 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 116 at Kernel->handle(object(Request)) in index.php line 53 at require_once('C:\xampp\htdocs\hmw\public\index.php') in server.php line 21

helpmyworld left a reply on ErrorException In CartController.php Line 73: Trying To Get Property Of Non-object

jameybay how do i debug? i am a newbie so please bear with me.

helpmyworld started a new conversation ErrorException In CartController.php Line 73: Trying To Get Property Of Non-object

Good day, My systEems sell books (Product) and Ebooks (Ebook). I first added the Product to my Cart Controller, i am able to add books to my cardt i added a line for ebook it says i should see line 73. is it possible to add two different items on one cart and how?

CartController

    {
        $product=Product::find($id);
        $ebook=Ebook::find($id);

        Cart::add($id,$product->name,1,$product->price,['size'=>'medium']);
        Cart::add($id,$ebook->name,1,$ebook->price,['size'=>'medium']);

        return back();
    }```

What is the right way to do what i need to do. Use a card to add two different items.

helpmyworld left a reply on MethodNotAllowedHttpException In RouteCollection.php Line 251:

adamprickett are you asking about this {!! Form::open(['route' => 'ebook', 'method' => 'POST', 'files' => true, 'data-parsley-validate'=>'']) !!}

helpmyworld started a new conversation MethodNotAllowedHttpException In RouteCollection.php Line 251:

Good day Please help me with this error

"MethodNotAllowedHttpException in RouteCollection.php line 251:" i am trying to create a post.

My route

Route::resource('ebook','EbookController');

My Controller

class EbookController extends Controller
{
   
    public function index()
    {
        $ebooks=Ebook::all();
        return view('admin.product.index',compact('ebooks'));
    }

   
    public function create()
    {
        $cats=Cat::pluck('name','id');
        return view('admin.ebook.create',compact('cats'));
    }


Mode

class Ebook extends Model
{

    protected $fillable=['name','description','cat_id','image','price'];

    public function cats()
    {
        //
        return $this->belongsToMany('App\Cat');
    }

}

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

@Snapey i was able to resolve this issue by moving my website to cloud dedicated hosting, it was on a shared hosting which made it slow, even a snail was better. So fast server and dedicated hosting solved my issue.

31 Aug
1 year ago

helpmyworld left a reply on Share My Blog Post With Facebook, And Other Social Medias

This is the best solution for me after thorough testing and learning.

https://www.addthis.com

helpmyworld left a reply on CSS Suddenly Stops Working In One Page

topvillas thanks i got it right,

30 Aug
1 year ago

helpmyworld left a reply on CSS Suddenly Stops Working In One Page

i am embrassed to continue asking but for the sake of understanding an learning, are you saying the below url is not the right url?

"view-source:http://rorisangmaimane.co.za/posts/public/files/css/bootstrap.css"

helpmyworld left a reply on CSS Suddenly Stops Working In One Page

topvillas please give me more clarity. i do not mean to sound slow or otherwise but please give me more clarity.

helpmyworld started a new conversation CSS Suddenly Stops Working In One Page

Good day, my css was working and still is working except on one page.

my website link is http://rorisangmaimane.co.za/posts/categories/All%20That%20Inspires%20Me perhaps i can be guided or have fresh eyes to look at what the issue might be.

Thank you

29 Aug
1 year ago

helpmyworld started a new conversation Controller Functions

Can i add do the following in my controller?

public function index(Category $category)
    {
//THIS FUNCTION MUST DISPLAY CATEGORIES FOR MY FRONT VIEWS
        $postsPerPage = 10; //As many posts as you want to show on each page
        $posts = $category->posts()->paginate($postsPerPage);
        return view('front.blog', compact('posts'));

//THIS FUNCTION MUST ADD CATEGORIES IN MY ADMIN
    $categories=Category::orderBy('name')->paginate(5);
      return view('admin.categories.index', compact('categories'));
    }

Every time when i want to display categories for admin i must comment the first function and uncomment the second, same will go for the display for the front, i comment the admin categories to display the front view categories. is the a better way?

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

@Snapey i just learned that the problem is with my website(www.rorisangmaimane.co.za). it is too slow, for example i add a product in my cart it takes forever to show the added item on the cart, after few minutes and couple of refresh the product display on the cart, same goes with adding and deleting, after i delete or change the quantity of the product i have to wait few minute and do refreshes to complete the tasks.

This is not good...

27 Aug
1 year ago

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

your questions are helping me to think and understand thanks, allow me to work on it.

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

@Snapey, i used tutorials to do this. I admit i just followed without truly grasping the full logic of how, why and what.

can my controller help to answer your questions?

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

@Snapey thanks, Please if you need more information please ask, i have become desperate because i thought my project was finished. Need i say that these features work on a local machine.

I do not have different carts, it is just one cart.

I am trying to buy an item, i add an items to my cart using <a href="{{route('cart.addItem',$book->id)}}" class="btn btn-success">Add to Cart</a>

On my cart i should able to see the update of the item, but it does not update. When i go inside the actual cart i see the items. I try to delete the item but i get the error to say nvalidRowIDException in Cart.php line 188: The cart does not contain rowId ce5452f389f041ab17e46324cc050c0d.

These are the first few lines of the error

at Cart->get('ce5452f389f041ab17e46324cc050c0d') in Cart.php line 166
at Cart->remove('ce5452f389f041ab17e46324cc050c0d') in Facade.php line 221
at Facade::__callStatic('remove', array('ce5452f389f041ab17e46324cc050c0d')) in CartController.php line 102
at Cart::remove('ce5452f389f041ab17e46324cc050c0d') in CartController.php line 102
at CartController->destroy('ce5452f389f041ab17e46324cc050c0d')
at call_user_func_array(array(object(CartController), 'destroy'), array('cart' => 'ce5452f389f041ab17e46324cc050c0d')) in Controller.php line 55
at Controller->callAction('destroy', array('cart' => 'ce5452f389f041ab17e46324cc050c0d')) in ControllerDispatcher.php line 44
at ControllerDispatcher->dispatch(object(Route), object(CartController), 'destroy') in Route.php line 204

Please if you need more information please ask, i have become desperate because i thought my project was finished. Need i say that these features work on a local machine.

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

and route

Route::resource('/cart', 'CartController');
Route::get('/cart/add-item/{id}', '[email protected]')->name('cart.addItem');

helpmyworld left a reply on The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

yes i can

My view

            @foreach($cartItems as $cartItem)
                <tr>
                    <td>{{$cartItem->name}}</td>
                    <td>{{$cartItem->price}}</td>
                    <td width="50px">
                        {!! Form::open(['route' => ['cart.update',$cartItem->rowId], 'method' => 'PUT']) !!}
                        <input name="qty" type="text" value="{{$cartItem->qty}}">


                    </td>
                    <td>
                        {{--<div > {!! Form::select('size', ['small'=>'Small','medium'=>'Medium','large'=>'Large'] , $cartItem->options->has('size')?$cartItem->options->size:'' ) !!}
                           </div>--}}

                    </td>

                    <td>
                        <input style="float: left"  type="submit" class="btn btn-success" value="Ok">
                        {!! Form::close() !!}


                    </td>
                    <td>


                        <form action="{{route('cart.destroy',$cartItem->rowId)}}"  method="POST">
                            {{csrf_field()}}
                            {{method_field('DELETE')}}
                            <input class="btn btn-danger" type="submit" value="Delete">
                        </form>
                    </td>
                </tr>
            @endforeach```

Controller

```<?php

namespace App\Http\Controllers;

use App\Product;
use App\Promotion;
use Gloudemans\Shoppingcart\Facades\Cart;
use Illuminate\Http\Request;

class CartController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $cartItems=Cart::content();
//        dd($cartItems);
        return view('cart.index',compact('cartItems'));
    }

   

    public function addItem($id)
    {
        $product=Product::find($id);
//

        Cart::add($id,$product->name,1,$product->price,['size'=>'medium']);
//

        return back();
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
//        dd(Cart::content());
//        dd($request->all());
        Cart::update($id,['qty'=>$request->qty,"options"=>['size'=>$request->size]]);
        return back();
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        Cart::remove($id);
        return back();
    }
}

helpmyworld started a new conversation The Cart Does Not Contain RowId Ce5452f389f041ab17e46324cc050c0d.

Can i please be assisted, i am able to add, increase quantity items and delete(remove) items in my cart on the local machine, i am now on the production server, i am unable to add or remove items on my cart.

I get the error to say

The cart does not contain rowId ce5452f389f041ab17e46324cc050c0d.```

Can somebody help me please.


25 Aug
1 year ago

helpmyworld left a reply on View Uploaded Images On Live Server - Change Public_path?

i added this route to solve this issue, in case someone have the same struggle.

Route::get('images/{filename}', function ($filename)
{
    return Image::make(public_path('images/' . $filename))->response();
});