Am getting this error Undefined property: App\Http\Controllers\ImageController::$postImage

Posted in CategoryLaravel
  • C
    Christian Simon 1 year ago

    Hi Hardik,

    Am getting this error Undefined property: App\Http\Controllers\ImageController::$postImage , I see you answering someone with the same issues below BUT I don't seem to Understand where to achieve that, Is it in my Controller or Model, THIS (((((you have to create model object for store data like :
    you have images table with Image Model
    so create object this way :
    $postImage = new Images;
    $postImage->add($input);

    This for store data, you can comment temporary. ))))) I DON'T Understand.

    I am following this tutorial : https://itsolutionstuff.com/post/laravel-5-image-upload-and-resize-example-using-intervention-image-packageexample.html

  • H
    Hardik Savani 1 year ago

    Hi Christian, 

    You need to do on your controller this way:

     

    $postImage = new Images;

    this is model Object and store in database.

    You can comment both line.

    //$postImage = new Images;

    //$postImage->add($input);

  • C
    Christian Simon 1 year ago

    Where, In which database is it stored? Can you give me a Github link to the whole working setup?

  • H
    Hardik Savani 1 year ago

    I don't have this example on github But i can solve your issue:

    First you can database configuration on .env file like as bellow:

    DB_DATABASE=h_boots

    DB_USERNAME=root

    DB_PASSWORD=root

     

    Then you can lean how insert update delete data working with model from here:

    https://itsolutionstuff.com/post/crud-create-read-update-delete-example-in-laravel-52-from-scratchexample.html

     

    Thank you

Please login or register to leave a response.

* You May Also Like Bellow Issue to check *